Hi All,
I’m having error System Events got an error: NSReceiverEvaluationScriptError: 4 when using UI Scripting. I did read all other posts on this error and I do have “Enable acces for assistive device” enabled, but still I get this error.
As a desperate attempt to figure out what’s causing this, I took the example of:
http://www.apple.com/applescript/uiscripting/02.html
tell application "Finder"
activate
end tell
tell application "System Events"
tell process "Finder"
tell menu bar 1
tell menu bar item "View"
tell menu "View"
tell menu item "Arrange"
tell menu "Arrange"
click menu item "by Size"
end tell
end tell
end tell
end tell
end tell
end tell
end tell
Looks pretty basic and should work alright? Well it doesn’t… It gives the error highlighting the “click menu item by size” . I checked with UI Inspector and noticed my menu item isn’t called Arragnge , but ‘Arrangged By’ and By Size should be 'Size". Ok changed that still the same…
I stripped the script to see what went wrong and noticed that I can click the ‘View’ menu:
tell application "Finder"
activate
end tell
tell application "System Events"
tell process "Finder"
tell menu bar 1
tell menu bar item "View"
tell menu "View"
click
end tell
end tell
end tell
end tell
end tell
I noticed the sinngle ‘click’ in stead of ‘click menu item “by Size”’ and I guess I’ve tried all possible combiantion, but
Does anyone have an idea???
Eventually I’m just trying to get Safari ‘save to pdf’
I’m using OS X 10.4.2
TIA
Browser: Safari 412.2
Operating System: Mac OS X (10.4)