NSReceiverEvaluationScriptError: 4 interaction with Safari
NSReceiverEvaluationScriptError: 4 interaction with Safari
- Subject: NSReceiverEvaluationScriptError: 4 interaction with Safari
- From: David Marshall <email@hidden>
- Date: Tue, 5 Aug 2008 20:16:42 -0400
On Mon, 4 Aug 2008 14:44:46 -0400, Sean R. McCorkle wrote:
tell application "System Events" to tell process "Safari"
As Yvan already implied, you need to make Safari the active
application before entering the System Events tell block.
And once you've done that, you don't need to point System Events at
Safari at all, as long as you use
keystroke return
as suggested by Ed.
then System Events will take care of everything. (Since System Events
is not talking to process "Safari" in this case, it won't understand
click button "Save" of sheet 1 of window 1
which is why you need the keystroke instead.)
- - - - -
tell application "Safari" to activate
tell application "System Events"
keystroke "s" using command down
delay 1
keystroke "d" using command down
delay 1
keystroke "c" using command down
set the clipboard to ((do shell script ("date +%Y%m%d_%H%M%S_")) &
(the clipboard))
keystroke "v" using command down
delay 1
keystroke return
end tell
- - - - -
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden