I’m teaching a student of mine some basics of Apple Script and we’re running into an issue using “System Events” that’s not making sense to me. On my personal laptop (Mac OS X version 10.4.8, Processor 2 GHz Intel Core 2 Duo) the following code works just fine:
tell application "Safari"
activate
tell application "System Events"
tell process "Safari"
set x to properties of button 1 of window 1
end tell
end tell
end tell
and my output looks as expected:
{position:{113, 27}, maximum value:missing value, name:missing value, size:{14, 16}, subrole:“AXCloseButton”, class:button, minimum value:missing value, enabled:true, selected:missing value, role:“AXButton”, help:missing value, title:missing value, value:missing value, entire contents:{}, description:“close button”, focused:false, orientation:missing value}
Running the same exact script on the school’s computer (Mac OS X version 10.4.9, Processor 800 MHz PowerPC G4), even in the administrator’s account, we get the following error:
AppleScript Error
System Events got an error:
NSReceiverEvaluationScriptError: 4
Both computers are running AppleScript 1.10.7. The computer support person has no idea what the problem could be. Any help would be appreciated.