G’day scripters, & Phil especially.
I’ve got it.
I managed to find a page on MacScripters, that Shane and others answered, after searching for the term ‘applicationDidFinishLaunching’ on Google, which I found on this page.
I then altered my code to…
#my initializingRoutines() end applicationwillFinishLaunching:
on applicationDidFinishLaunching:notification my initializingRoutines() end applicationDidFinishLaunching:
on initializingRoutines() etc
and…
on turnOnAssistiveDevices(theFlag) try set my displayAssistiverDevicesFlag to true # flag to set visible of Assistive window activate me windowAssistiveAccess's makeKeyAndOrderFront:me on error errmsg display dialog "turnOnAssistiveDevices " & errmsg end try
tell application "System Preferences" tell pane id "com.apple.preference.security" to reveal anchor "Privacy_Accessibility" activate try repeat while exists pane id "com.apple.preference.security" tell current application to delay 0.2 end repeat end try end tell set my displayAssistiverDevicesFlag to false end turnOnAssistiveDevices
and all my windows that are supposed to be open are.
Obviously whatever there OS send to finishing opening an opening App is not sent until the app acknowledges that it’s open (well, I know what I mean). Now I just need to figure out how to set the position of my advice window right next to the Assistive devices preferences window. Fun.
Regards
Santa
|