Apple Intelligence now features Image Playground, Genmoji, Writing Tools enhancements, seamless support for ChatGPT, and visual intelligence.

Apple Intelligence has also begun language expansion with localized English support for Australia, Canada, Ireland, New Zealand, South Africa, and the U.K. Learn more >

You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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 Account.