September 12, 200718 yr Newbies I have a container field which contains a file reference, and another field that displays the path to that external file. I'd like to make a script (button) which simply reveals the original external file in the OS X Finder. A calculated Applescript may be the answer but I have no idea as to syntax. Suggestions??
September 12, 200718 yr Once you have a Mac syntax file path (which you can calculate if needed), then it's fairly simple. You have to get the quotes and returns right in the calculation. If the Mac path is in a field called "Filepath": "tell application "Finder"¶ reveal file "" & Filepath & ""¶ activate¶ end tell" A Mac path looks like: "Macintosh HD:Users:fej:Documents:some file.txt" I imagine there's a Unix command for this also, but I can't remember offhand; I always use the above. Maybe the Unix command would be to just open the folder, which works. But the above also scrolls to and highlights the file, which is a nice touch. Edited September 12, 200718 yr by Guest
September 15, 200718 yr Author Newbies That's great. Thank you very much. But I'm really struggling to turn a FM path into an HFS path. I found a custom function online called FilePathToHFS but I can't get it to work and it doesn't seem to deal with the fact that FM gives you BOTH windoze and mac filepaths. So any suggestions as to a formula or algorithm that can convert FM paths to HFS paths?
September 15, 200718 yr http://www.satimage.fr/software/en/file_paths.html http://www.briandunning.com/cf/743 --sd
September 15, 200718 yr I worked out some calculations for this. They are kind of long, so I'm just going to upload an example file, which I built for displaying images via a calculation, no matter which platform inserted them. It may not work in all situations, but the calculations are in there. The _cOS_FilePath is the relevant one. But it depends on 2 others, for the Drive and the Volume name. RemoteImage_MacPC_calc.fp7.zip
September 15, 200718 yr Author Newbies Thanks Fenton!!! That file will be invaluable. In the meantime I came up with this formula to translate FM paths into Applescript-friendly paths: Substitute ( Right ( Location_path ; (Length ( Location_path )-(Position ( Location_path ;"filemac" ; 1 ; 1 )+8) )) ; "/" ; ":" ) It finds the string "filemac" and deletes it and everything before it, then substitutes colons for slashes. Fancy huh? At least it works...for my mac users anyway... Many thanks again.
Create an account or sign in to comment