Jump to content
Macro Express Forums

put filename in a "save as" box, from a file


bugmero
 Share

Recommended Posts

Hi all,

 

I have small question, i have a lot of files to save, and i want them to be saved lie 100, 101, 102 ,103 ... 1100,....etc, and i was thinking that i should put all the filenames in a text file and let macro express get them from there in order, anyone knows how to do this .

 

Can i do this other way ?

 

Thanks,

Jack

Link to comment
Share on other sites

I'm not sure I understand what you are trying to do. Will the names of the saved files consist ONLY of the numbers, or will numbers be appended to an existing name? Yes, putting the names of the existing files into a text file sounds like a good idea, then use Text File Begin Process loop to retrieve the names, generate new name, copy old to new with the DOS copy command.

 

See recent topic, "Outputting numbers with leading zeros". You can use a technique like that to build the new filenames on the fly. Output numbers with or without leading zeros. Just concatenate the base filename with the generated number then do the DOS copy command as described above.

 

If I have misinterpreted what you need, give us some more details and we can go from there.

Link to comment
Share on other sites

OK i will try to explain better :

 

1.I have some reports that i need to print in pdf format

2.I have created a macro that will get me to the point of pressing print and i receive the "save as " window, as for to save in pdf file.

3.I need to save each report with a different name, i could be a something like 100,101,102 ,the file names.when i receive the save as box the file name is always report, and i need put after report the numbers or delete report and put the numbers, in any case is ok .

 

This is actually what i need.So the idea with the txt file was to generate numbers from 100 to 3000 and and when i'm geting the save as box just to give me the next number in line.

 

Thanks,

Jack

Link to comment
Share on other sites

You can use an Integer variable to insert the number. Depending on how the macro is run, you may need to save the variable to a text file as well for the next run through.

Variable Set String %T1% from File: "filename"
Variable Modify String: Convert %T1% to integer %N1%
// Place code here to print and type integer value
Variable Modify Integer: %N1% = %N1% + 1
Variable Modify Integer: Convert %N1% to text string %T1%
Variable Modify String: Save %T1% to Text File

 

The above code will load a variable from a text file, convert it to an integer. After your code has run to print the file, it will add one to the integer value, convert it back to a string and save it to the text file for the next time the macro is run.

 

You will need to create the text file before creating the macro. The file needs to be saved as a Text file and contain the number you wish to begin with.

Link to comment
Share on other sites

Thanks for the help, i will try the code, i did something also with a txt file, i did a copy&paste thing, a generated all the numbers for the filenames and i told the script to copy the number on with the cursor is on and after go down with one row , and then paste the value in the save as file name .

 

I will also try the script that you posted , it looks easier .

 

Thanks for all the help

 

Jack

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...