Hi: I'm trying to send a keyboard key to my system:
ie: "type "m" with commandkey
to fire a "Keyboard Maestro" macro, and can't seem to get that to work.
If I type "m" with commandkey from anywhere, the macro is fired off, but when I do that from a LiveCode script, Livecode seems to trap the message internally (ie: "command "m" is typed into whatever field is currently selected)
??
invoking a macro with a key command
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: invoking a macro with a key command
Might Applescript help here? You can "do" a handler as "applescript", if Keyboard Maestro is compliant.
Craig
Craig
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: invoking a macro with a key command
Hi Craig:
I tried this and it did not work:
a field called "ascript" with contents:
tell application "System Events" to keystroke "m" with command down
button script:
do field "Ascript"
I tried this and it did not work:
a field called "ascript" with contents:
tell application "System Events" to keystroke "m" with command down
button script:
do field "Ascript"
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: invoking a macro with a key command
I am no AppleScripter. But I bet that is the best, if not only way.
Anyone else?
Craig
Anyone else?
Craig
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: invoking a macro with a key command
go it!
You have to ADD "as Applescript" after your script.
do tScript as Applescript
You have to ADD "as Applescript" after your script.
do tScript as Applescript