Re: UI Printing
Re: UI Printing
- Subject: Re: UI Printing
- From: Thomas Fischer <email@hidden>
- Date: Fri, 5 Mar 2010 16:00:00 +0100
Am 05.03.2010 um 14:47 schrieb Bill Cheeseman: On Mar 5, 2010, at 8:34 AM, Thomas Fischer wrote: I realised two things about the command keystroke "p" using {command down}
– the command is case sensitive, keystroke "P" doesn't work, although the shortcut is called ⌘P. – the curly braces are not mentioned in System Event's library, is this something oovious?
And I somehow lost the context: Is there a particular reason not to use Mail's print command like
tell application "Mail" to print Window 1
or something similar before
click button 1 of sheet 1 of window 1
In GUI Scripting's 'keystroke' command, if you capitalize the letter, the Mac thinks you're holding down the Shift key. So 'keystroke "P" using {command down}' is equivalent to 'keystroke "p" using {command down, shift down}'. That actually works in some applications that have an alternate Shift-Command-P print command that does something different than the regular print command.
Curly braces are standard AppleScript. They signify an AppleScript list, in this case a list of terms identifying which modifier keys are down.
I checked the curly braces and they seem to be superfluous for single "decorations" but are needed when there is more than one. And keystroke "P" has the same effect as keystroke "p" using {shift down}.
But something else is strange: If I run
activate application "Mail" tell application "System Events" tell process "Mail" keystroke "p" using {command down} # click window 1 # click button 1 of sheet 1 of window 1 end tell end tell
nothing happens until I move the mouse, click it or perform some other action. If I activate
click window 1
the sheet appears immediately. Has anybody an explanation?
Thomas
|
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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