Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Applescript:Check folder exists

I'm having a problem getting this to work. I have found a working version using the finder

set msg to "Error"

tell application "Finder"

set displayappath to (path to home folder as text) & "music"

if existsdisplayappath then

set msg to "Check"

end if

end tell


display dialogmsg


I'm trying to use it in Xcode, but I get an error. Why will the work outside Xcode, but not inside


*I tried adding as Alias, but that only worked on a folder that exists, once I change it to test it I got another error

telling me it wasn't found.


would setting the


Hopefully Some know why


Thanks

PowerMac, Mac OS X (10.6.7)

Posted on Jun 18, 2011 3:50 PM

Reply
5 replies

Jun 18, 2011 5:10 PM in response to Jon Lopiano

you might take the 'path to' line out of the Finder tell block:


set msg to "Error"

set displayappath to (path to home folder as text) & "music"

tell application "Finder"

if existsdisplayappath then

set msg to "Check"

end if

end tell


display dialogmsg


path to is part of the Standard Additions osax, and XCode might be being picky about handler scope.

Applescript:Check folder exists

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.