Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Fun with fortune and FileMaker Pro Apps
Went to a conference this last week, and ran the registration booth. It was a small conference so I only needed to make badges for about 30 late registrants - over three days. That left a lot of time fiddling about. So, as most bored users will do, I fired up fortune in terminal.

But whenever I was interrupted (ahem) for actual work, I was switching back to Filemaker. Realizing that I could probably send output to Filemaker and eliminate the switching, I womped up the following.

In Filemaker, made a global text field, named fortune. Then added a FileMaker Pro script with this AppleScript:
set textResult to [do shell script "/sw/bin/fortune"]
tell application "Filemaker Pro"
set cell "fortune" of current record to textResult
end tell
I've got a fink installation, so your path to fortune may vary. I set a button on the FileMaker layout to trigger the script and added the fortune field on the screen with a monotype font and a scrollbar (for longer fortunes). It was a great conversation starter; people were actually hanging out just to read them, and we had a lot of fun when I changed the switch to fortune -o. ;)

I know this sounds like a completely useless geegaw, but just think about how much more powerful FileMaker can be reading results from grep with this simple AppleScript syntax. More fun to follow.
  • Currently 3.00 / 5
  You rated: 4 / 5 (2 votes cast)

Fun with fortune and FileMaker Pro | 3 comments | Create New Account
Click here to return to the 'Fun with fortune and FileMaker Pro' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Where can I get it?
Authored by: aranor on Feb 22, '02 04:13:59PM

Where can I get Fortune?

[ Reply to This | # ]
Use fink...
Authored by: robg on Feb 22, '02 06:54:11PM
As a relative novice in UNIX, I found 'fink' to be the best source for easy to install versions of programs like fortune. In this case, after installing fink, all you'll need to do is type
sudo apt-get install fortune-mod
and you'd have fortune installed and running. I just did this myself, and now I can do:
% fortune
"I have more information in one place than anybody in the world."
-- Jerry Pournelle, an absurd notion, apparently about the BIX BBS
There are a few hints posted here on installing fink; it's actually relatively easy. Search on "fink" and you should find the articles. -rob.

[ Reply to This | # ]
FM Pro, AppleScript, Shell Script
Authored by: scott_manelis on Feb 22, '02 05:44:00PM

You could just use one applescript line in FM Pro:

set cell "whatever" of current record to [do shell script "date"]

I think that may be a bit faster.

[ Reply to This | # ]