Google "applescript open folder"
Link #3 may be useful - posting to an Applescript specific forum may get a better response.
I tried that. The applescript part of opening the folder seems pretty straightforward. The only problem i'm having is getting the field name in filemaker to act as a variable in applescript for the folder name.
Is there no way to pass data from a field in filemaker to applescript? I know how to make applescript open a folder to me if i know the path. The problem is i need to know how to turn a field value into an applescript variable.
I've gotten a little closer. The script below gives me the value i need. In the next script i need to replace the number "067" with the result of the first script. Is there any way to do that? Also, like i said, i'm very new to this. i'm sure there is a way to condense the two scripts into one. I'm open to suggestions.
tell application "FileMaker Pro Advanced"
cell "mylarID" of current record
tell application "Finder"
open folder "CP-Mylars:067:"
Is this not possible?
"Open url"might help as it supports http, ftp, file, and mailto URL types:
It doesn't mention folders, though.
I'm a rank novice, who would like to also open a set of related files in a folder from Filemaker, so, assuming you figure it out, let us know how.
On Windows, Open URL does the job perfectly. You can capture the ID as a $Variable and set the path name using it.
I believe that what you want can be done in AppleScript as I've seen any number of apple script examples that use data from FileMaker, but I'm not aware of any current Forum participants, including myself, that are fluent in Applescript. You may need to research this one on an Applescripting site or a different FileMaker forum.
Pate - why does Open URL not work for you?
To get data from filemaker into an applescript, you have to use applescript to grab the data.
That is what is happening in the tell me statement below
The Job number is grabbed from the current record and saved into a variable.
This script gets job number from the database named "JSR9",
It then gets the last digit of the Job Number and determines if it is an even number or odd number
Even numbered jobs are stored on a volume named AraxiVolume_2B
Odd numbered jobs are stored on a volume named AraxiVolume_1A
so a variable named RaidVolume is set based on the last digit of the job number (even # or odd)
Then we tell the finder what to do
So, if the job number was 45678, this is what is opened: AraxiVolume_2B/Jobs/45678_CustomerName/UserDefinedFolders/
I did it that way because we dont put the customer name in the database in the same way we name the folders.
Thus I have the script open "every folder whose name begins with JobNo"
But you can alter the script to open a specific folder if that is a known entity.
If you do that, the script will run MUCH faster
My way is slow because applescript has to look at EVERY folder on the volume and see which ones start with the job number
-- START SCRIPT
tell database "JSR9"
tell current record
set JobNo to cell "JobNo" as string
set LastDigit to last character of JobNo
set LastDigit_div2 to LastDigit / 2
set LastDigit_rounded to round LastDigit_div2
if LastDigit_rounded = LastDigit_div2 then
set RaidVolume to "AraxiVolume_2B:Jobs"
set FolderPath to alias "AraxiVolume_2B:Jobs:"
set RaidVolume to "AraxiVolume_1A:Jobs"
set FolderPath to alias "AraxiVolume_1A:Jobs:"
tell application "Finder"
--open folder RaidVolume
set x to (every folder whose name begins with JobNo) of FolderPath
set TheFolder to item 1 of x
-- open TheFolder
open folder "UserDefinedFolders" of TheFolder
-- END SCRIPT