Re: FMPro to Contacts (AddressBook)
Re: FMPro to Contacts (AddressBook)
- Subject: Re: FMPro to Contacts (AddressBook)
- From: Bruce Robertson <email@hidden>
- Date: Fri, 08 Nov 2013 13:33:51 -0800
That's why I choose a completely different approach; which I find much simpler.
NO escaping.
Set a variable to a block of text that holds the applescript you want; with place holders in the text.
Use FileMaker substitutions instead; and then "perform calculated applescript" after the substitutions have been made.
Set Variable [ $baseScript; "display dialog theUserName" ]
Set Variable [ $myScript; substitute( $baseScript; "theUserName"; quote(get( userName)))]
Perform Applescript [ $myScript ]
The above method also make the script easy to debug in the FileMaker script debugger.
In FileMaker Advanced, you can examine the contents of $myScript and even modify them while testing.
Bruce
On Nov 8, 2013, at 1:07 PM, Jim Weisbin wrote:
> FM and Applescript form a very a potent combination. So much of what we do in FM11 is AS scripted in some way or other. Having said that, I wish someone would write a program to parse an Applescript and add all the escape codes required for a “Calculated” Applescript in FM. Most of my time spent writing these is just trying to figure out syntax to escape the double quote characters. Especially if you are calling a shell script from within your calculated Applescript. For example, this is part of a script which calculates your IP address. It took me awhile to figure out all those backslashes!
>
> "tell application \"Finder\Ӧ
> ...
> set my_interface to do shell script \"netstat -rn -f inet | egrep \\\"^default\\\" | awk '{print $6}' \"¶
> ...
> end tell ¶
> "
>
>>
>>> I've been asleep for a few years when it comes to AppleScript
>>> and FileMaker... Has the AppleScripting in FileMaker improved? Is it good
>>> enough to use now?
>>
>
>
> Jim Weisbin | C.T.O. | human | 138 Fifth Avenue | 3rd Floor | New York, NY | 10011 | (212) 352-0211 | (917) 375-2272 | Los Angeles Office | 2046 Broadway | Santa Monica, CA | 90404 | (310) 264-0211 telephone | www.humanworldwide.com
>
> Click here to view our online reel
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden