Apple Script and keys

Posted:
in Mac Software edited January 2014
Is it possible to make a script in Apple Script which holds down a key on the keyboard? If so, what must I do?

Comments

  • Reply 1 of 1
    doughboydoughboy Posts: 47member
    Hi,



    You can try downloading a free scripting addition called <a href="http://www.eagrant.com/Sigmas-Additions.sit.hqx"; target="_blank">Sigma's Additions</a>, which adds a single command: type text. You can add text to a document and also select various menu items, provided they have keyboard equivalents. To use it, you would do something like:



    [code]tell application "AppleWorks 6"

    activate

    make new document at beginning

    tell front document

    type text "This is a test."

    type text "a" holding down command -- select all

    type text "b" holding down command -- make bold

    end tell

    end tell</pre><hr></blockquote>



    Unfortunately, there's a twenty character limit, so entering a large amount of text is cumbersome.



    Hope this helps.



    [ 06-17-2002: Message edited by: DoughBoy ]</p>
Sign In or Register to comment.