Reveal container contents in Finder
I wanted to reveal container contents in the Finder. I found this and it works:
The FileMaker syntax full path to the file is the last line of what you get with GetAsText (container field). The following returns the AppleScript Mac path from either a file or image inserted into a container field (by a Mac). Let ( [ info = GetAsText ( Contain ); vc = ValueCount ( info ); FM_path = GetValue( info; vc ) ]; Substitute ( FM_path; ["imagemac:/"; ""]; ["filemac:/"; ""]; ["/"; ":"] ) ) To reveal the file, use the following in a Perform AppleScript step, with the by calculation option: Let ( [ info = GetAsText ( Contain ); vc = ValueCount ( info ); FM_path = GetValue( info; vc ); Mac_path = Substitute ( FM_path; ["imagemac:/"; ""]; ["filemac:/"; ""]; ["/"; ":"] ) ]; "tell application \"Finder\"¶" & "activate¶" & "reveal \"" & Mac_Path & "\"¶" & "end tell" )
The files are to be stored on a server. I want to add a custom message If the file isn't there or the server isn't mounted. Filemaker gives an error but it is a little confusing. I would also like to display different message if the file is not a reference.
I'm adding this feature to an existing database that has images that are not stored as reference files. They are to be replaced with references as time goes by. To help this process I'd like to be able to indicate whether the file is a reference or stored in the database. I have a field that displays the file path (a calculation "=container"). If the image is a reference my file path field has "imagemac/volume/imagename" in it. If not a reference it has just the file name. I cant figure out how to use this to trigger a value such as "on Server" or "Not on Server".
FM Pro Advanced 10