I’m in a situation where I have this for example, from a text field in the UI:
/Users/joe/Desktop
And I’d like to covert any given path like that to a colon-delimited path like this:
Macintosh HD:Users:joe:Desktop
So I can interact with the finder to create a folder.
I’ve been using something like this:
tell application "Finder"
set macPath to POSIX file theDirectory -- where theDirectory is the /Users/joe/Desktop string from a text field in the UI
make new folder in folder macPath with properties {name:theFolder} -- where theFolder is a string from a text field in the UI
end tell
But I keep getting this error:
Finder got an error: Can’t get «class psxf» “/Users/joe/Desktop”. (-1728)
In a nutshell what I’m trying to do is, take the unix style path from the UI, and a name from the UI, and make a folder at the unix style path location, named whatever the name is from the string in the UI.
What am i doing wrong? Anyone that can chime in, I’d be very grateful!