Re: AppleScript with FileMaker
Re: AppleScript with FileMaker
- Subject: Re: AppleScript with FileMaker
- From: Don Rossi <email@hidden>
- Date: Mon, 25 Jun 2018 11:19:33 -0400
I’ve been doing this since Filemaker 5
1. Every FM solution has table called “Applescripts” and every field in there
is a global
2. In the Applescripts tabled is ALWAYS a field called “as_readytorun_g” and
one called “as_result”
3. Other fields are called “as_” + some description of script function
(as_copy_file)
These fields contain a “raw” applescript with values to be substituted
all those values are like this:
set my_db_name to “xyxy_database_name”
Anything that begins with “xyxy_”, I know that is something that must
be substituted into the script. I try to keep this at the top of the raw
applescript
4 Create a FM script that will substitute the raw applescript field into
“as_readytorun_g” and replace “xyxy_” values with data necessary. Name this FM
script very much like the raw applescript field.
There are other very specific steps I follow but this is a synopsis.
This has worked for me for many many years. The beauty is that every script is
a clean copy of the applescript. Years ago when there were buggy, memory
leaking applescripts, my solution never crashed
> On Jun 25, 2018, at 10:36 AM, Jim Weisbin <email@hidden> wrote:
>
> On Fri, 22 Jun 2018 David Crowe <email@hidden
> <mailto:email@hidden>> wrote:
>
>>
>> IV. Method 4. Capture the actual AppleScript.
>>
>> You cannot run the calculated string in an external editor for two reasons.
>> First of all, it contains escaped quote marks, strange line markers (¶) and
>> FileMaker calculations. So, if you had your entire script within a FileMaker
>> calculated string, how would you debug it?
>>
>> Well, it’s actually quite simple (although it took me a long time to think
>> of it). Write a simple FileMaker script that takes an AppleScript as a
>> parameter, copies it to a FileMaker field and then executes it. If you then
>> want to do some debugging you just take the executed source from the
>> FileMaker field and copy it into a script editor. Once you debug it you have
>> to edit changes back into FileMaker watching for escaping quotes and line
>> endings, but if the changes are small it’s not so bad. If you completely
>> rewrite the script externally, then with an editor you need to globally
>> change all straight double quotes to \” and all line endings to ¶. Again,
>> not bad once you get used to it.
>>
>> Now all your applescripts are in your single FileMaker file, and you can
>> even do things like “tell application x” where “x” is a variable (FileMaker
>> field).
>
> Could you please explain this in more detail? It sounds great, but I don’t
> quite get how to do it.
>
>>
>>
>> Then there’s the ugly question of how to get data from your AppleScript back
>> into FileMaker, but that’s another story
>
> Very often I set up a global field in FM that I can paste the Finder’s
> clipboard into, then AppleScript just has to write the data to the clipboard
> in a format that can be parsed by Filemaker. It’s just way easier IMHO than
> trying to script FM directly from AS.
>
> Thanks.
>
>
> Jim Weisbin | C.T.O. | Human | Post Human |
>
> Jim Weisbin | C.T.O. | Human | Post Human | 27 West 20th Street | Suite 801 |
> New York, NY | 10011 | (212) 352-0211 | (917) 375-2272 | 2046 Broadway |
> Santa Monica, CA | 90404 | (310) 264-0211 telephone | www.humanworldwide.com
> <http://www.humanworldwide.com/>
> Click here <http://www.humanworldwide.com/#commercials> 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