Re: Filemaker 8.5 stored applescript problem
Re: Filemaker 8.5 stored applescript problem
- Subject: Re: Filemaker 8.5 stored applescript problem
- From: Malcolm Fitzgerald <email@hidden>
- Date: Thu, 17 May 2007 12:23:58 +1000
On 17/05/2007, at 3:56 AM, Stockly, Ed wrote:
M> It can be a nuisance, but comments don't get compiled, so you have
them
there for re-use if/when you can't get them out of the way.
I'm a little lost here, are you saying copy and paste your comment
into your
script every time you save?
No, each time you run the script in Smile or SE.
I'm suggesting that you keep a copy of the raw code protected by --
commenting .
If you have to test the code repeatedly in Script Editor or Smile the
interpreter will "pretty print" the raw code. That's not what we want.
However, comments aren't interpreted, so the comments will have the raw
code.
By "getting them out of the way" I mean having the read or write
functionality stored in a handler or script library.
If you're saying putting the read write command in a handler to avoid
the
terminology conflict, that would not work in this case, because
handlers in
scripts launched from within filemaker are also executed as commands to
filemaker, and I believe the same is true for libraries used from those
scripts (but I'm not sure about that part).
You are right about the context but the point is that handlers or
libraries are not being recompiled on every run so it is not necessary
to replace the raw code each time you run through the script.
Clearly the simplest, easiest, appleScriptiest solution is to enclose
the
commands in a Finder or System Events tell.
There's less typing in the raw codes method ;-)
In this case I would argue that
it's not noticeably less "efficient" or slower than the alternatives,
unless
you're executing hundreds or thousands of OSAX calls.
It is always slower even on a single run. The question is, "Does it
matter?"
I use FMP/Applescript combinations so frequently that I choose to the
raw code method even when timing isn't an issue because its rock solid.
One issue is that the tell method creates an unnecessary dependency.
The osax doesn't need another app to do it's work, the tell method
does. It is quite likely that the Finder is already busy (System Events
is probably twiddling it's fingers) so you immediately begin time
sharing. Apart from that, I like to think that code aggregates. If I
build a handler that uses the most efficient methods I'm confident that
it will work well.
malcolm
_______________________________________________
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