I’m building an AppleScript application in XCode part of which ask the user to select a folder.
when I log the path I get this:
/Volumes/IMAGEDUMP/Online_Shop_Originals/2010/GI/GI_Test/0001_TestFolder_GI/Product
I want to convert this UNIX path to an AppleScript reference but when I log
set pathtodestination to choose folder with prompt “Select a destination folder”
log POSIX file of pathtodestination
I get this error message:
Can’t get «class psxf» of alias “IMAGEDUMP:Online_Shop_Originals:2010:GI:GI_Test:0001_TestFolder_GI:Product:”. (-1728)
I don’t remember having this problem before. I am on 10.5.8,
RIRedinPA:
I
log POSIX file of pathtodestination
I get this error message:
Can’t get «class psxf» of alias “IMAGEDUMP:Online_Shop_Originals:2010:GI:GI_Test:0001_TestFolder_GI:Product:”. (-1728)
log POSIX path of pathtodestination
I’m not trying to coerce it to a Unix path, I’m trying to get it to a AppleScript reference. My question is why when I log the results of choose folder I am getting a Unix style path:
/Volumes/IMAGEDUMP/Online_Shop_Originals/2010/GI/GI_Test/0001_TestFolder_GI/Product
but then, when I go to convert that using POSIX file I get the error message basically indicating that the path is already an AppleScript reference, why isn’t it colon delimited after the choose folder command? Shouldn’t the path be this style:
IMAGEDUMP:Online_Shop_Originals:2010:GI:GI_Test:0001_TestFolder_GI:Product:
on choose folder? I am selecting a folder on a Window’s server and am mounted using SMB, would that affect it?
Also in AppleScript Studio choose folder returns an alias
You get the HFS path by coercing it to text
set pathtodestination to (choose folder with prompt “Select a destination folder”) as text
Because you are coercing the AppleScript alias into a POSIX path with your line:
log POSIX file of pathtodestination
I think you just want
set pathtodestination to choose folder with prompt "Select a destination folder"
log pathtodestination as text
Or if you change the choose folder to Stefan’s example
set pathtodestination to (choose folder with prompt "Select a destination folder") as text
log pathtodestination