hello
i have a couple of indesign scripts and would like to write a gui for them.
my idea was that i should have a controller.scpt to control the gui, and to load and run all the, so to say, sub-scripts when needed. i’d also like to have a progress indicator, and this is where my problem begins.
below is the basic idea of the whole:
controller.scpt
on clicked theObject
if name of theObject is "doItAllButton" then
runMe(window "mainWIn") of (load script of file (((path to me) as string) & "Contents:Resources:Scripts:doItAll.scpt"))
end if
end clicked
doItAll.scpt
on runMe(controller)
tell application "Adobe InDesign CS2"
tell controller to set maximum value of progress indicator "progInd" to count of every story of active document
repeat with i from 1 to count of every story of active document
--do the whole stuff here
tell controller to set content of progress indicator "progInd" to i
end repeat
end tell
end runMe
the problem i seem quite unable to solve on my own is this:
- the “tell controller…” can’t be nested inside “tell application “Adobe InDesign CS2”…” - i don’t actually know why, but it just doesn’t work that way
but on the other hand - the “tell controller…” can’t be outside of it because it needs to be run every time a story is finished - otherwise it would just have two states: 0% and 100% finished which somewhat undermines the very idea of it.
is there some kind of way to leave the “tell application…” clause just for the “tell controller…” line? or should i be trying to access the controller some other way?
could you help me please?
Model: mac mini g4
AppleScript: 1.9.3
Browser: Safari 312.6
Operating System: Mac OS X (10.3.9)