Emoji Variables

I came across a Swift fun fact a couple days ago courtesy of Global Nerdy. It turns out you can use Emoji (those symbolic characters that help mobile phone users around the world express real human emotions) in certain components of your code, including variables. That got me wondering about FileMaker. We have variables. We have real human emotions. Can we play too?

It turns out we can on the Mac (I haven’t attempted this on a PC). Fundamentally, Emoji are characters like (this week’s sponsors) the letter Q and the number 2. Given that you can name a variable just about anything you like, there’s no reason you can’t give it an Emojinal name. Here’s how I got it to work in FileMaker Pro Advanced 13 running on OS X Yosemite.

  1. Create a new script and add a Set Variable script step.
  2. In the Name box, type in two dollar signs.
    Set Variable dialog box.
  3. Open up your Character Viewer. (If this item doesn’t appear in your menu bar, go to your System Preferences, open the Keyboard Preference Pane, choose the Input Sources tab and check “Show Input menu in menu bar”.)
    Show Character Viewer from input menu
  4. Select “Emoji” from the left column then drag the Emoji character of your choice to the Name field in the Set Variable dialog box. I chose a globe because it’s a global variable. I find this amusing despite your groans and eye-rolling.
    Emoji from the Character Viewer
  5. Select the contents of the Name field and copy.
  6. Enter something in the Value field. It doesn’t really matter what you put here so long as you don’t leave it blank. Click OK.
    Selected Emoji variable
  7. Add a Show Custom Dialog script step. Give it any title you want and paste your variable name into the message body.
    Emoji variable script
  8. Save your script and run it. If it works, you’ll see the value of your Emoji variable in the dialog box.
    A working Emoji variable

This technique probably has no practical applications, so I wouldn’t use it in a production database. Certainly not a mixed platform, multi-user production database. Still, it’s a pretty decent FileMaker geek party trick.

This entry was posted in FileMaker 13. Bookmark the permalink.