When running a loop script which is processing lots of records, redrawing of the window to show the updates can take a while, so if you call the Freeze Window script step before starting the loop, no window updates are performed and loops will finish quicker.
It is advised to goto a layout with a please wait message or something and then return to the original layout after the loop has finished.
When you are automating exports of user data from a FileMaker file, the easiest place for the user to be able to find the exported file at a later date is on the desktop. How can you export a file there? Using the Get(DesktopPath) script function!
It returns the path to the desktop folder with a trailing slash ready for you to append a filename to, for example:
$file = Get(DesktopPath) & “export.xml”
Would return something like ‘/C:/Documents and Settings/Username/Desktop/export.xml‘ on a Windows machine and something similar to ‘/MacintoshHD/Users/Username/Desktop/export.xml‘ on a Mac.
If you save it to a variable you can then use it in an export path to enable dynamic export paths to the user’s desktop, without having to know their platform and system username.
If for whatever reason you don’t want to use the Send Mail script step, you can achieve the same by using the Open URL script step as well.
Just use something like the following as the address:
“mailto:” & Email_Address & “?Subject=” & Subject & “?Body=” & Message
Where you change Email_Address, Subject and Message to hardcoded values, variables or fields.
It will open up a new message to be sent from the default installed mail client the same as the Send Mail step does.
Get(ActiveModifierKeys) (previously known as Status(CurrentModifierKeys) can be a very useful tool for running different script steps in different situations. For example, you could have a ‘New Record’ button, but if a certain combination of keys that only certain users knew were held down, then it could delete the current record instead.
Below is a reference of some combinations of the modifier keys in FileMaker:
Case(
Get(ActiveModifierKeys) = 1, “Shift”,
Get(ActiveModifierKeys) = 2, “Caps Lock”,
Get(ActiveModifierKeys) = 3, “Shift with Caps Lock”,
Get(ActiveModifierKeys) = 4, “Control or Cntrl”,
Get(ActiveModifierKeys) = 5, “Shift - with - Control or Cntrl”,
Get(ActiveModifierKeys) = 6, “Caps Lock - with - Control or Cntrl”,
Get(ActiveModifierKeys) = 7, “Shift - with - Caps Lock - with - Control or Cntrl”,
Get(ActiveModifierKeys) = 8, “Option For Macs - Alt For Windows”,
Get(ActiveModifierKeys) = 9, “Shift - with - Option For Macs - Alt For Windows”,
Get(ActiveModifierKeys) = 10, “Caps Lock - with - Option For Macs - Alt For Windows”,
Get(ActiveModifierKeys) = 11, “Shift - with - Caps Lock - with - Option For Macs - Alt For Windows”,
Get(ActiveModifierKeys) = 12, “Control or Cntrl - with - Option For Macs - Alt For Windows”,
Get(ActiveModifierKeys) = 16, “Command For Macs”,
“No Modifier Keys Are Held Down”)