![]() |
Looping through macro
This posts how to loop through the values in a text file http://www.kinook.com/Forum/showthread.php?threadid=231
but what about looping through the values in a macro? I have a macro that contains file names , one on each line. This macro was created from %LASTSTEP_OUTPUT%. I then want to process each of these files that the macro contains. vbld_NextDelimValue() works on a tab delimited macro, so I am assuming that I need to loop through my original macro and create a tab delimited macro with vbld_AddDelimValue, but I can't figure out how to loop through the original macro. Thanks for any help. |
One option would be to replace newlines with tab chars when initializing your macro. A Run Script step with VBScript code of:
' store last step output, replacing newlines with tabs for compatibility with vbld_NextDelimValue Application.Macros(vbldMacroTemporary).Add "MY_MACRO", Replace(Application.Macros(vbldMacroSystem)("LASTSTEP_OUTPUT"), vbCrLf, vbTab) would do it. Another option would be to copy the vbld_NextDelimValue system script function to project or global scripts, rename it and tweak for your needs (i.e., use vbCrLf instead of vbTab). |
I got this error when running the specified script
Error at Line 1, Column 1 (Object variable not set) |
1 Attachment(s)
Not sure without seeing your code, but attached is a complete sample that demonstrates the process you want to use.
|
Thanks.
Everything is working as expected. |
All times are GMT -5. The time now is 07:50 AM. |
Copyright © 1999-2023 Kinook Software, Inc.