Professional Web Applications Themes

Simple AppleScript question - Mac Programming

I'm not sure whether this is the appropriate forum. If not, please redirect me. I'm using the Speakable Items feature in MacOS X. I want to add a simple AppleScript that tell iTunes to play, wait 5 minutes and tell iTunes to stop playing. This works : tell application "iTunes" play delay 300 stop playing end tell But the computer stops listening spoken commands until the timer has shot. When the script terminates, the spoken commands queue gets suddently flushed. I don't know AppleScript very well. Would it be possible to work around the problem ? I thought it might ...

  1. #1

    Default Simple AppleScript question

    I'm not sure whether this is the appropriate forum. If not, please
    redirect me.

    I'm using the Speakable Items feature in MacOS X. I want to add a simple
    AppleScript that tell iTunes to play, wait 5 minutes and tell iTunes to
    stop playing.

    This works :
    tell application "iTunes"
    play
    delay 300
    stop playing
    end tell

    But the computer stops listening spoken commands until the timer has
    shot. When the script terminates, the spoken commands queue gets
    suddently flushed.

    I don't know AppleScript very well. Would it be possible to work around
    the problem ?

    I thought it might be possible to install a crontab that would tell
    iTunes to stop but I don't know how to do that.
    -> tell application "iTunes" to play
    -> Install a crontab to make it stop in 5 minutes

    Any help ?

    --
    Julien Salort
    [url]http://www.juliensalort.org[/url]
    Julien Salort Guest

  2. #2

    Default Re: Simple AppleScript question

    In article <1fzp06t.i4blormtfmg6N%mailjuliensalort.org>,
    [email]mailjuliensalort.org[/email] (Julien Salort) wrote:
    > I'm not sure whether this is the appropriate forum. If not, please
    > redirect me.
    alt.comp.lang.applescript is probably the best newsgroup for questions
    about AppleScript.
    > I'm using the Speakable Items feature in MacOS X. I want to add a simple
    > AppleScript that tell iTunes to play, wait 5 minutes and tell iTunes to
    > stop playing.
    >
    > This works :
    > tell application "iTunes"
    > play
    > delay 300
    > stop playing
    > end tell
    >
    > But the computer stops listening spoken commands until the timer has
    > shot. When the script terminates, the spoken commands queue gets
    > suddently flushed.
    > I don't know AppleScript very well. Would it be possible to work around
    > the problem ?
    It depends on how Speakable Items works. According to your description
    of the problem, it seems that as long as the script is not completed,
    Speakable Items will wait doing nothing. If this is the case, a solution
    would be to put your script in a separate applet. The Speakable Items
    script would simply launch it and quit, allowing new commands to be
    spoken and recognized.

    Patrick
    --
    Patrick Stadelmann <Patrick.Stadelmannunine.ch>
    Patrick Stadelmann Guest

  3. #3

    Default Re: Simple AppleScript question

    In <Patrick.Stadelmann-8A458F.18141614082003news.fu-berlin.de> Patrick
    Stadelmann wrote:
    > a solution
    > would be to put your script in a separate applet. The Speakable Items
    > script would simply launch it and quit, allowing new commands to be
    > spoken and recognized
    I agree; this is what I was going to suggest. m.

    --
    matt neuburg, phd = [email]matttidbits.com[/email], [url]http://www.tidbits.com/matt[/url]
    REALbasic: The Definitive Guide! 2nd edition!
    [url]http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt[/url]
    Subscribe to TidBITS. It's free and smart.
    matt neuburg Guest

Similar Threads

  1. Need Simple Answer to Simple Contribute/Firefox question
    By Adobe nickname in forum Macromedia Contribute General Discussion
    Replies: 2
    Last Post: February 13th, 06:59 PM
  2. simple question!!!!!
    By costinp78 webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 1
    Last Post: October 27th, 06:13 PM
  3. Simple PHP question.
    By Stefan in forum PHP Development
    Replies: 2
    Last Post: September 20th, 04:45 PM
  4. Really simple Question.
    By Graham Mattingley in forum ASP
    Replies: 2
    Last Post: September 4th, 09:14 PM
  5. Simple IF question
    By Rick Altman in forum FileMaker
    Replies: 5
    Last Post: July 15th, 09:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139