applescript stack overflow error on basic script

Discussion in 'Mac Programming' started by mrawn, Feb 10, 2011.

  1. mrawn macrumors newbie

    Joined:
    Feb 10, 2011
    #1
    I'm trying to make a script to open Pandora desktop on login and pause it (app wont launch paused)

    If I run the script in applescript editor it works perfect. But when I save it as an application and run it, I get a Stack Overflow error. Any help would be greatly appreciated!

    My script is:
    tell application "Pandora"
    run
    end tell
    delay 3
    tell application "Pandora"
    activate
    tell application "System Events" to keystroke " "
     
  2. neutrino23 macrumors 68000

    Joined:
    Feb 14, 2003
    Location:
    SF Bay area
    #2
    Don't you need an "end tell" after activating Pandora?

    You could also put in dialog statements after each action to see where the bad actor is.
     
  3. mrawn thread starter macrumors newbie

    Joined:
    Feb 10, 2011
    #3
    oh, i pasted the code wrong. there is actually an end tell at the end...

    I tried your suggestion and discovered that it is failing trying to run pandora. Suddenly I had an epiphany. I named the applescript application "Pandora"! It was trying to run itself! I changed the name and it works.

    What a simple solution...
     
  4. neutrino23 macrumors 68000

    Joined:
    Feb 14, 2003
    Location:
    SF Bay area

Share This Page