Manage Value lists window should include folders. #FileMaker (via @msorich)
drewsanderson
growlnotify over network
When using growlnotify be sure that the user on the computer displaying the growl messages has privileges to run terminal.  Open Directory allows admins to prevent access to applications.  I have terminal access blocked for most of my users.  This block was preventing access to growl notify.
Here is an example of what to use with the applescript step in FileMaker to send growl notifications.
do shell script “usr/local/bin/growlnotify -m ‘message here’ Â -H 192.168.1.1”
The receiving computer has to have listen for incoming connections enabled under the “network” tab of the growl preference panel.
Enjoy 🙂
Drew
Hide Mac Desktop Icons
If you are like most mac users, your desktop get polluted with large numbers of icons from files that you save to your desktop and then never quite get time to “file away”. This trick with the below applescript / shellscript will cover your bad habit and make you look much more organized / professional than you are when it counts 😉
Please note you are doing the below at your own peril and I am not responsible what may or may not happen to your computer /data. Â You might want to check out the man page for the command used for more information:
http://www.manpagez.com/man/1/chflags/
Step 1: Launch Script Editor
MacintoshHD/Applications/AppleScript/ScriptEditor
Step 2: Create two scripts:
1. Paste in the following:
do shell script “chflags hidden ~/Desktop/*”
2. Go to File -> Save As
3. Save the script to:
Macintosh HD/Users/youruser/Library/Scripts/Hide Desktop
4. Under Script Editor File menu select New
5. Paste in the following:
do shell script “chflags nohidden ~/Desktop/*”
6. Go to File -> Save As
7. Save the script to:
Macintosh HD/Users/youruser/Library/Scripts/Show Desktop
Step 3 – Add scripts to menu bar
1. Â Launch Applescript Utility
(Macintosh HD/Applications/AppleScript/AppleScript Utility)
2. Â Make sure there is a check next to “Show Script menu in menu bar”
Note that if you uncheck Show Computer scripts it will remove from view all the scripts that ship as part of OS X. Â That is what I did to simplify my menu but that is your call.
Step 4 – Go to the menu bar (upper right) and click on the scroll icon. Â You should now see the two scripts. Â Click on them to hide or unhide the desktop.
Remove a key from a return delimited list
I needed to remove a key from a return delimited list of keys and came up with this formula. Â I also went ahead and made a custom function that is in this sample file.
Let
(
[
$text = example::original ;
$key = example::key_to_remove ;
$text_length = Length ( $text ) ;
$key_length = Length ($key) ;
$key_position = Position ( $text; $key; 1; 1 )
];
Left ( $text ; $key_position – 1 ) & Right ( $text ; $text_length – $key_position – $key_length )
)
Truly Custom Dialog box with multiple records and related data in FileMaker
I was challenged with creating a pop-up dialog box containing information from multiple records and related data.  Obviously a “Show Custom Dialog†script step would not work.
Solution:
- Create your layout to display the data.
- Layout should be list view
- Note the height and width of the new layout for 1 record
- Have initial script run
- When the initial script needs the custom dialog which was entered with an If script step the following script steps happen.
- Set Variable:  Set a variable containing the width of the new layout.  This will be used for centering the new layout over the layout.
- New Window:
- Label the window.  I used a variable ( $title ) so that I could reuse it when I use the close window script step.
- The prompt for my situation was when there were one or more records that needed chosen.  That is when I set the variable $record_count.  I set the height of the window based on the number of related records.  This is done by multiplying the $record_count by the height of one record on the new layout.
- I set the distance from top to zero to allow for the most number of records to be seen.
- Distance from left was set using the previously set $dialog_width variable and the Get (ScreenWidth) function. Â Basically I divided the width of the screen and then subtracted half the width of dialog box. Â This centers the box on the screen. Â I could have just typed the numbers in but decided to use the $dialog_width variable for three reasons:
- If I need to tweak it in the future I will only have to change the number in one place instead of two.
- It is easier to see in the ScriptBuilder
- Variables are cool 🙂
- So cool in-fact that I decided to set the height with one as well for consistency.
- I then enter a loop. Â This keeps the user from doing anything else until they make a selection
- On the custom dialog I have two buttons.  When either selection is chosen it sets a variable to 1.  This is looked at every 1 second by using a Pause/Resume Script and specifying 1 second duration.  The Exit Loop If step looks for either variable to be set to one.
- Using If and Else If script steps  you can  choose what action to take based on which global variable is set to 1.  In my case, when $choice_1 is set to 1 then a script will be performed.  If $choice_2 is 1 then the new window is closed and the script is exited.
- I reused the window name variable ( $title) I had previously used to name the specific window to close.