February 27, 200817 yr I'm trying to script a command to open a folder on the Mac My PC solution just uses a send event which works just fine, but does nothing on the mac. I'm setting a variable that is the $Filepath and passing that to the send event open document script command but nothing happens. Any ideas - maybe an apple script (something I'm not competent in at all) Thanks
February 27, 200817 yr Well, the AppleScript can be as simple as: tell application "Finder" activate open "Macintosh HD:Users:fej:Desktop:Registrations xml:" end tell The "activate" above brings the folder to the front; otherwise it opens behind FileMaker's window. You would need to put this in a Perform AppleScript step, by calculation, with the path produced from a field (I suppose, I don't know whether your folder path is static or dynamic). You have to escape the quote marks, by preceding with a backslash; i.e., the result must look like the above. Notice a folder path ends in ":". You can see that the AppleScript file path syntax is not the same as FileMaker's (nor Unix, nor Windows). But it's pretty easy to convert a FileMaker syntax path to AppleScript's syntax. Just take off the "filemac:/" and Substitute "/" with ":". The drive name, "Macintosh HD", may differ on different machines, as it is user-editable. You can use one of FileMaker's functions to get it, like Get ( DriveName ), Get ( DocumentsPath ) or Get ( DesktopPath ). Alternatively, you can use OpenURL, with a path like this (yes, 3 "///"): "file:///Users/fej/Desktop/Registrations xml/" Edited February 27, 200817 yr by Guest
February 27, 200817 yr Author I just knew the venerable Fenton (maybe it should be "fountain" considering the widsom you pour out on this forum) would arrive with the solution. Ah yes, the /// is what did me in on the open url approach I tried opening the finder as a script command but not in the apple script. That went nowhere also. As always, thanks a million Fenton.
February 27, 200817 yr Yes, I think it's 2 slashes on Windows. I read somewhere that according to the "rules", it should really be 3 for a local file.
April 7, 200817 yr Is there a simple way to simply open the file path in a finder window. I don't want the actual file to open, just take the user to the location in a new finder window. Something like this: set test to alias "Macintosh HD:Users:brett:Documents:Mileage:2007.10.3 TDS Mileage.xls" tell application "Finder" activate open (path to test) end tell
April 7, 200817 yr The cutest way is to use the "reveal" command. If you have the file path, it will open the folder, then highlight the file. set test to alias "Macintosh HD:Users:brett:Documents: Mileage:2007.10.3 TDS Mileage.xls" tell application "Finder" activate reveal test end tell
Create an account or sign in to comment