Activate F11 key in X11 with applescript

Hello. I am starting as a home transcriptionist on my mac. Long story short:

My work only does dictations in the olympus proprietary *.dss files - which i thought express scribe for mac was able to use, as in the PC version, but it doesn't. So I have decided to run Darwine and X11 to run the Express Scribe PC version.( www.nch.com.au/scribe ) It works totally fine, loads the files and plays them, apart from I cannot use the function keys to control it when in Word which is very frustrating.

So I am trying to write an applescript and redirecting a System wide all applications hotkey using the application Spark. So what I need is to tell the X11 application to press F9 for play when the applescript is activated - but not to activate expose. And obviously another two applescripts to press F7 for fastforward and F8 for rewind and F4 for stop.

When trying to write the applescript:
Tell Application "X11" to key code 101
which is what I got from google, it says syntax error, A identifier can’t go after this property.

Please help i'm quite desperate

Macbook pro 15" 2007 model, Mac OS X (10.6.1)

Posted on Oct 6, 2009 3:50 AM

Reply
3 replies

Oct 6, 2009 6:33 PM in response to peterjames

The “key code” command just simulates pressing a key on the keyboard. The result will depend on which application is frontmost. For example, if you want to press a few function keys while X11 is the frontmost application, just use the following statements:

tell app "X11" to activate
tell app "System Events"
key code 118 --> F4
key code 98 --> F7
key code 100 --> F8
key code 101 --> F9
end tell

You might look at this [web page|http://lists.apple.com/archives/applescript-studio/2003/Dec/msg00056.html] to find the key codes of other function keys.

However, I'm afraid F9 will just activate Exposé. I don't know how to simulate pressing the “fn” key while using any of the function keys.

Message was edited by: Pierre L.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Activate F11 key in X11 with applescript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.