Re: applescript-users digest, Vol 3 #2563 - 9 msgs
Re: applescript-users digest, Vol 3 #2563 - 9 msgs
- Subject: Re: applescript-users digest, Vol 3 #2563 - 9 msgs
- From: Michael Ziober <email@hidden>
- Date: Sat, 27 Mar 2004 11:24:58 -0800
Steven and Ron: Thanks for the leads. Unfortunately, they didn't pay
off.
On Fri, 26 Mar 2004 21:20:34 -0700, roncross wrote:
You can use ASCIIseek to simulate a control key command. On my
keyboard, it is ASCII number 246; it may be something different on your
computer. Just put this in an applescript as follows:
key down (ASCII character 246) -- on my machine the control key is
ASCII character 246. The control key will be a caret symbol.
Be sure to wrap it with the appropriate tell commands, system events,
etc.... This is a system events.
I'm not trying to TYPE the caret character here; I'm trying to PRESS
the control key. Pressing only the control key in ASCIIseek displays
nothing because it has no character code. I assume you meant
"keystroke" above and not "key down", which I don't have in my version
of System Events (1.2.1). Do you have something else installed which
provides "key down"?
On Fri, 26 Mar 2004 19:33:35 -0700, Steven Sanders wrote:
You might try Extra Suites at:
http://www.kanzu.com
It has the ability to type keys with modifier keys.
Extra Suites has almost exactly the opposite of what I need: it allows
TESTING to see if a modifier key is down, but no way to SET the state
of a modifier key, which I now believe would be way beyond the
abilities of a faceless app. I do not need a way to, for example,
simulate the user typing Command-Z. I can already do that with System
Events:
tell application "System Events"
keystroke "z" using {command down}
end tell
What I'm looking for is something more like this (which is not real
code, only wishful thinking):
tell application "System Events"
keyboard press {control key} --press and hold the control key...
tell process "iDVD"
--iDVD now thinks the control key is being held down
do amazing things
end tell
keyboard release {control key} --release the control key
end tell
I foresee two obstacles to my wish being fulfilled: This may be
something that has to go all the way down to SystemUIServer or even the
keyboard driver, which probably excludes anyone other than Apple from
being able to do it; I can imagine poor error trapping leaving the
keyboard with modifiers pressed, which would result in a really bad
user experience. Even so, I still think it's worth suggesting...
System Events
Processes Suite
Commands
keyboard press option key/control key/shift key/command key
keyboard release option key/control key/shift key/command key
Any other ideas out there?
Michael
On Wednesday, March 24, 2004, at 10:32 AM, I wrote:
Does anyone know how to make iDVD 3 running on OS X 10.3.2 think that
_just_ the control key is down? Hopefully something better than "lay a
book on the control key"! :-)
iDVD (aside from its odd object model and dictionary) has an
unofficial feature which checks the state of the control key, plus a
few other things, when burning a disc, which allows it to be used to
automatically batch build and "burn" DVDs as disk images.
Unfortunately, iDVD is testing the key directly as opposed to whether
it is used as a modifier for a keyboard event, so "keystroke using
control down" isn't what I need.
I have a keyboard map which indicates that the code for the control
key is 0x3B, but "key code 59" doesn't seem to have any effect. It
appears to generate a single keyboard event, rather than allowing me
to set the key state to down, send a command to iDVD, and then set the
state to up. This makes sense because the syntax makes no distinction
as to the key state.
Finally, I stumbled across this key combo by random experimentation:
press and hold LEFT control key, press and hold RIGHT control key,
release LEFT control key, release RIGHT control key. This locks the
control key in the down state. Press and release the LEFT control key
to unlock it. Oddly, this combination works only for the control key
and no other modifiers. It also seems to be independent of any
keyboard or universal access settings, so why is it there?
While the last method is functional, it's also an ugly hack which is
very confusing when you forget that it's active! So, does anyone have
any wisdom on using key code or perhaps an OSAX that works with
Panther? I'm willing to entertain anything: BSD, SystemUIServer,
System Events, etc.
Thanks,
Michael
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.