Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript automation, ActionIsRunning not working

Status
Not open for further replies.

vcherubini

Programmer
May 29, 2000
527
US
Hi,

I have a VBScript to automate a ReRasterize action I've created within Illustrator. The action takes the DPI of images (RasterItems) within an AI file from 300+ DPI to 72DPI. The action works fine, and I've got the script working to perform that script.

However, if the AI file is large (larger than, say, 3MB, so very easy to hit this value with 300+DPI images), the script dies because Illustrator returns control back to the script before the Action has completed. This is documented in the Adobe Scripting documentation. There is a fix to this, just to test if ActionIsRunning, and if so, to sleep:

while ( appRef.ActionIsRunning )
WScript.sleep 1000
wend


Unfortunately, this does not work on my computer. I get an Unspecified Error when running the script.

Here's the code:

[tt]
for each item in rasterArt
item.Selected = true

' Argument 1: The action to perform
' Argument 2: The action group the action is a member of
' Argument 3: Show alerts or not
appRef.DoScript "ReRasterize", "Wilma", false

while ( appRef.ActionIsRunning )
WScript.Sleep 2500
wend
next
[/tt]

I get the error on the while ( appRef.ActionIsRunning ) line.

Furthermore, if, outside of the for each loop I call appRef.ActionIsRunning I don't get an error and it runs fine.

Any help would be greatly appreciated.

Thanks!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top