• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Overhead in Using Run Script in a Loop ???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Overhead in Using Run Script in a Loop ???
      • From: Axel Luttgens <email@hidden>
    • Re: Overhead in Using Run Script in a Loop ???
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Gatekeeper
  • Next by Date: Re: Overhead in Using Run Script in a Loop ???
  • Previous by thread: Re: Apples incoherent dealing with windows
  • Next by thread: Re: Overhead in Using Run Script in a Loop ???
  • Index(es):
    • Date
    • Thread