AppleScript of Script Editor is failing

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

  1. Soggymass macrumors newbie

    Joined:
    Apr 18, 2010
    #1
    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 Soggymass.app" of folder "Desktop" of folder "Ryan" of folder "Users"
    of startup disk then
    display dialog "It Exists"
    else
    display dialog "No it doesn't"
    end if
    end tell

    I have ScriptApp Soggymass.app 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?!?!?!?!?!?!?

    Soggymass
    macrumors newbie
     
  2. mysterytramp macrumors 65816

    mysterytramp

    Joined:
    Jul 17, 2008
    Location:
    Maryland
    #2
    I'm guessing your issue is "if exists application" Try instead: "if exists file"

    You might also try:

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

    mt
     
  3. Soggymass thread starter macrumors newbie

    Joined:
    Apr 18, 2010
    #3
    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
    Code:
     if exists application file 
     

Share This Page