Hi:
I’m trying to move some files that are referenced in Filemaker Pro container fields.
The references look like:
file://Macintosh HD/Users/joe/Desktop/Picture 1.png
I’ve used POSIX paths before, but not with the “file://” prefix.
Can I move a file in an Applescript using the reference in its current form or do I have to do some text delimiter stuff to knock out the file prefix?
Thanks.
–jon
Hi jon,
I would use code as follows to convert the FileMaker file reference for use in an AppleScript:
set filemakerpath to "file://Macintosh HD/Users/joe/Desktop/Picture 1.png"
-- strip 'file://', add '/Volumes/' to create a Posix path
set posixpath to ("/Volumes" & ((characters 7 through -1 of filemakerpath) as Unicode text))
-- converting to a Mac alias
set filealias to (POSIX file posixpath) as alias
Once I realized your three lines of code couldn’t work inside a tell application “Finder”, it worked like a charm.
Many thanks.
–jon