emilyraynor

Using variable in FileMaker Script

Discussion created by emilyraynor on Dec 8, 2017
Latest reply on Dec 12, 2017 by emilyraynor

Hello, I am trying to create a button on my FM template that opens a corresponding folder on a networked server (corresponding to a value in a field).

 

Here is what I have so far, but the script is not giving the the expected outcome.

 

Set Variable [ $jobno ; Value: Project File Server Locations::_4_digit_job_No. ]

If [$jobno ≤ "0100" ]

Perform AppleScript [ "tell application "Finder"     activate     make new Finder window     set target of Finder window 1 to folder "Projects 0001 - 0100" of disk "TRG Projects" end tell" ]

Else If [ "0100" < $jobno ≤ "0200" ]

Perform AppleScript [ "tell application "Finder"     activate     make new Finder window     set target of Finder window 1 to folder "Projects 0101 - 0200" of disk "TRG Projects" end tell" ]

Else If [ "0200" < $jobno ≤ "0300" ]

Perform AppleScript [ "tell application "Finder"     activate     make new Finder window     set target of Finder window 1 to folder "Projects 0201 - 0300" of disk "TRG Projects" end tell" ]

 

And so on...repeating with all the increments 301-400, 401-500, 501-600, etc.

 

End If

 

What is happening is this:

When I am on record 0517, for example, the button using the above script opens folder "Projects 0601 - 0700" so it seems to be following the next "if" below the one it should be using.

Outcomes