I have a series of actions that are called from AppleScript. However, the next action in the AppleScript is being called before the first previous one completes. Is there a function, property, status (or anything else) that will indicate that an action is still running?
You might try something like this placing a delay after each action and varying it as required. The number is seconds.
--get a sourceFolder that holds the files to print
set sourceFolder to (choose folder with prompt "Choose a folder with files to process:") as text
-- get a list of files of the files to be printed in the sourceFolder
tell application "Finder" to set workingFiles to (every file of folder sourceFolder) as alias list
repeat with workingFile in workingFiles
tell application "Adobe Illustrator"
open workingFile
tell current document
do script "export" from "Default Actions" without dialogs
delay 1
end tell
close current document without saving
end tell
end repeat
I don't think you can run VB in a mac.
you didn't find the property in applescript? maybe it is called something else?....hmm, then as a workaround, maybe you can have your action do one additional step at the end of it, like for example change the color of a path, or select the top most object, then you could check if such last step is done then you'll know your action is done, if is not, sleep, check again later.
Neither AppleScript nor Javascript have that property. I checked the guides here: https://www.adobe.com/devnet/illustrator/scripting.html
I ended up creating an object at the end of each Action and assigning an attribute to it. The AppleScript goes into a repeat loop after executing each action and breaks out once the object exists. It then deletes the object and executes the next action. Not ideal, but it seems to work.
on waitAction()
tell application "Adobe Illustrator" to tell document 1
repeat
set xxx to (every page item of layer 2 whose note = "Trigger")
if xxx ≠ {} then
delete xxx
exit repeat
end if
delay 1
end repeat
end tell
end waitAction
maybe you can have your action do one additional step at the end of it, like for example change the color of a path, or select the top most object, then you could check if such last step is done then you'll know your action is done
The last step of my action selects similar objects based on stroke color. My script then needs to evaluate the count of selected path items. When I create a new object with a specific attribute to signal the action is complete, the selected items from the previous step de-select. Can anyone recommend an action that will not de-select the current selection but will signal my Script that the action has completed?
North America
Europe, Middle East and Africa
Asia Pacific