Jump to content
Server Maintenance This Week. ×

Linking to folders


This topic is 5852 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Ok, Ok, I know this topic has been discussed quite a bit already. First, before it's suggested, my client is plug-in shy.

So, the solution I have so far:

- Select folder to link to using applescript.

- Take path returned by applescript, replace ":" with "/" and add "file://" prefix. Save this to a field called FolderPath.

- To open the folder, use "Open URL" script step on FolderPath.

Here's the applescript:

set theResult to false

tell application "Finder"

try

set FolderAlias to choose folder

set theResult to FolderAlias as string

end try

end tell

tell application "FileMaker Pro Advanced"

tell database "woj08"

tell table "LinkedFiles"

set cellValue of cell "Path_g" to theResult

end tell

end tell

activate

end tell

This works great for local folders; the hitch is with network mounted volumes. I seemingly successfully link to a network folder; however, on trying to open the linked folder (with open URL), I get an Error Code 5 (Command is invalid).

This is what the folder path looks like that returned by my script (and causes the error):

file://My Documents/My Pictures/

Yes, I'm linking to a folder on a PC on the same network. I tried linking to folders on another Mac with the same result. If I manually edit the folder path to:

file://valatard/Volumes/My Documents/My Pictures/

This works fine with the Open URL script step. It seems that my applescript is not returning me the full file path (including machine and volume) for network mounted drives. By contrast, here's what a WORKING folder path, from my LOCAL drive, returned by my script returns:

file://Brusel/Users/loncook/Documents/

What the heck am I missing here. Somebody tell it's something stupid I overlooked.

Link to comment
Share on other sites

This topic is 5852 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.