AnsweredAssumed Answered

Reveal container contents  in Finder

Question asked by buck_5648798798 on Mar 25, 2010
Latest reply on Oct 1, 2017 by lavalitedude

Title

Reveal container contents  in Finder

Post

Hi.

 

I wanted to reveal container contents in the Finder. I found this and it works:

 

http://www.mail-archive.com/fmpro-l@listserv.dartmouth.edu/msg02482.html

 

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".

 

Thanks!!

 

FM Pro Advanced 10

Mac 10.6.2

Total Noob

 

 

 

Outcomes