Overhead in Using Run Script in a Loop ???
Overhead in Using Run Script in a Loop ???
- Subject: Overhead in Using Run Script in a Loop ???
- From: Rick Gordon <email@hidden>
- Date: Fri, 02 Mar 2012 15:51:58 -0800
I'm setting up a script to run successively on the contents of a InDesign book, and rather than building all the functionality into a single file, I'd prefer to use run script to run other scripts that are configured to operate on one document (many of which are already written) like this:
set vMyPath to path to me
tell application "Finder" to set vParentFolderPath to folder of vMyPath as string
set vScript1 to (vParentFolderPath & "Script-01.scpt") as alias
set vScript2 to (vParentFolderPath & "Script-02.scpt") as alias
set vScript3 to (vParentFolderPath & "Script-03.scpt") as alias
tell application "Adobe InDesign CS5.5"
set vApp to a reference to it
tell active book
set vItemCount to count items of book contents
repeat with i from 1 to vItemCount
tell item i of (book contents as list)
set vBookItem to object reference
tell vApp to set vCurrentDoc to open full name of vBookItem without showing window
tell vCurrentDoc
run script vScript1
run script vScript2
run script vScript3
end tell
end tell
end repeat
end tell
end tell
On a large number of files, is there an overhead problem with this approach?
--
___________________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________
WWW: http://www.shelterpub.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden