Stefan, what if you didn’t know the exact window title but it contained at least “Process Extracted Parts.”
That TG tools window on mac at least says " Process Extracted Parts 3.32 " (with a space in the beginning and end along with a very specific version number). I want to wait until it’s active but not sure with a name that is ambiguous.
I downloaded the demo version of Finale but I am unable to use it correctly so I will just post a piece of code which I didn’t tested.
property finaleProcess : "Finale 2014"
on win_wait_active(theObjectID)
tell application "System Events" to tell process finaleProcess
repeat until exists (first window whose name starts with "Process Extracted Parts")
delay 0.2
end repeat
end tell
end win_wait_active
What do you mean by convenience handlers, Stefan? You mean like having helper functions? Like having a separate file that contains the methods/functions win_wait_active, etc.?
Is most of the performance loss referencing the other helper script or is it mainly lost another way…?
I would assume it is mostly to do with when you do :
tell something to
tell something to
tell something to
do something
do something else
do something different
do something again
end tell
end tell
end tell
writing it out longways that way. however when I write
It’s not a performance issue, I’m just speaking from experience: write code as straight as possible.
Any splitting code into handlers, separate scripts etc. is more error-prone to break the UI responding chain.
The shortest code is not always the most effective
of course you have to use that snippet in an System Events and process tell block
property finaleProcess : "Finale 2014"
tell application "System Events"
tell process finaleProcess
-- click a menu item or do something else to open a window
repeat until exists (1st window whose title contains "Extracted")
delay 0.2
end repeat
end tell
end tell