Jump to content
Macro Express Forums

looping to change filenames Open+Save


paperguy

Recommended Posts

Hi;

 

Even though I haven't grasped a lot of it's capabilities, it's easy to see that this software readily allows ones creative urges to be released.

 

My problem - I need to to alter a series of .pdf's (text characters and numeric ending filenames) one at a time in Adobe Illustrator and then save them as .ai files. For the .ai files I am using pg1.ai, pg2.ai... and so on. Then I take the files into Flash CS3 and convert them to .swf files.

 

I created a Captured macro that works reliably on the first pdf filename, e.g. XY 54 32 1.pdf and saves it out to pg1.ai. Currently in the macro I use the TextType command to input the Open "XY 54 32 1.pdf" filename and then the Save As "pg1.ai" filename.

 

Scanning the tutorials and help pages it seems a Text File Process reading a filelist.txt with the appropriate Open and Save filenames might do the trick. In the Text File Process loop how do I get the Open and Save text variables to increment so they can be placed in the Open and Save file dialog boxes?

 

Or is there a better way to do this?

 

Thanks

Link to comment
Share on other sites

If I understand correctly what you are trying to do, here is what I would suggest. Place the .pdf file names in a .txt file. Use the Text File Begin Process command to read the first file name from the list and save to a variable such as T1.

 

Use the Text Type command to open the file saved to T1. Set an Integer variable such as N1 to 1.

Save the file as pg%N1%.ai which translates to pg1.ai.

Increment the value of N1 so that it is now 2.

 

The process repeats with the second file name in the list and saves the file to pg2.ai.

 

Below are the basics. You will need to fill in the functions to open the file, open the save as dialog, etc.

 

Text File Begin Process: "pdflist.txt"

Text Type: %T1%

Variable Set Integer %N1% to 1

Text Type: pg%N1%.ai

Variable Modify Integer: Inc (%N1%)

Text File End Process

Link to comment
Share on other sites

If I understand correctly what you are trying to do.....

Below are the basics. You will need to fill in the functions to open the file, open the save as dialog, etc.

 

Text File Begin Process: "pdflist.txt"

Text Type: %T1%

Variable Set Integer %N1% to 1

Text Type: pg%N1%.ai

Variable Modify Integer: Inc (%N1%)

Text File End Process

 

Thanks Stan, it's exactly what I needed. I found it worked a little better with the "Variable Set Integer %N1% to 1" placed before the "Text File Begin Process" line.

 

It took me awhile to get timing set for all the windows, but I've sorted mostly out except for one pdf. This one pops up a Windows dialog box asking me to choose one of two options. This screws up the macro. In the dialog box the option I want is already highlighted - so all I would have to do is to instruct Macex to type the ENTER key.

 

Could I use the "If Window" to test the presence of this dialog box and then on the result, take appropriate actions?

Link to comment
Share on other sites

Could I use the "If Window" to test the presence of this dialog box and then on the result, take appropriate actions?

 

Okay, I've got the 1st half of my automation completed, 12 .pdf's modified and converted to 12 .ai files in about 5 minutes.

 

I've only had 3 hrs. sleep last night and it's hard to think straight. I programming the 2nd half of my automation 12 .ai files modified and converted to 12 .swf files.

I getting through it slowly but I have a real turkey of a question, (tried Help but didn't find it there), the Windows "Select All" command <CTRL>+A is it simply TEXT TYPE: <CTRL>A or is that like pressing <CTRL> and letting go then pressing A ?

 

Thanks

Link to comment
Share on other sites

For the Windows "Select All" function you would use the Text Type command to look like this: TEXT TYPE: <CTRL>a

This holds down the ctrl key while the "a" is pressed. Use a lower case "a", otherwise it will be interpreted as Ctrl Shift a.

Link to comment
Share on other sites

For the Windows "Select All" function you would use the Text Type command to look like this: TEXT TYPE: <CTRL>a

This holds down the ctrl key while the "a" is pressed. Use a lower case "a", otherwise it will be interpreted as Ctrl Shift a.

Great, that solved a problem or two.

Getting near the end (both the project and my consciousness level) , I had a control window with 20 lines of parameters, vertically stacked that I needed to change one in the middle. So I used this:

Get Control %C8% (Export Flash Player: Edit)
Set Focus to %C8%
Mouse Double Left Click on Control %C8%
Delay 55 Milliseconds
Text Type: 35

By the way I had "Get Control using Text" turned off.

Worked GREAT!

 

Then when I returned to the "stage" of FLASH there is a property panel with data entry boxes for Width, Height, X offset and Y offset, so I decided to use the same technique but it keeps failing tell me the control could not be found. Here is the code for the Width entry box:

Get Control %C10% (: Edit)
Set Focus to %C10%
Mouse Double Left Click on Control %C10%
Delay 55 Milliseconds
Text Type: 620<ENTER>

 

So am I to infer all control boxes aren't created equal ;)

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...
×
×
  • Create New...