AppleScript of Script Editor is failing

Discussion in 'Mac Programming' started by Soggymass, Apr 18, 2010.

  1. Soggymass macrumors newbie

    Apr 18, 2010
    Okay i'll give the problem strait out.
    AppleScript isn't finding my apps when i type a directory. Even if I check it, and get the one that TechSmith has made. Well, the script I typed was:

    tell application "Finder"
    if exists application "ScriptApp" of folder "Desktop" of folder "Ryan" of folder "Users"
    of startup disk then
    display dialog "It Exists"
    display dialog "No it doesn't"
    end if
    end tell

    I have ScriptApp on my desktop, but I always end up getting the dialog "No it doesn't". Can anyone tell me how to fix this problem that AppleScript can't find my folders; files or apps?!?!?!?!?!?!?

    macrumors newbie
  2. mysterytramp macrumors 65816


    Jul 17, 2008
    I'm guessing your issue is "if exists application" Try instead: "if exists file"

    You might also try:

    set desktopPath to (path to desktop) as string
    set appPath to desktopPath & "ScriptApp"
    if exists appPath then
    	display dialog "It exists"
    	display dialog "It doesn't"
    end if
    Like this, you avoid a tell block.

  3. Soggymass thread starter macrumors newbie

    Apr 18, 2010
    So why did my original script work a few days ago. My Computer has broken somehow and i'm calling the ADC Worldwide Telephone Support when I get the chance.
    EDIT: OMG, a fatal error for me.... i should have written
     if exists application file 

Share This Page