Re: Adobe's lousy AppleScript implementations
Re: Adobe's lousy AppleScript implementations
- Subject: Re: Adobe's lousy AppleScript implementations
- From: email@hidden (Michael Sullivan)
- Date: Sat, 28 Sep 2002 22:53:25 -0400
- Organization: Society for the Incurably Pompous
has writes:
>
David Crowe wrote:
>
>
>Thanks for all your hints. One of the problems that I have is the use
>
>of QuicKeys so that I can connect the scripts to a hot-key.
>
>
>
>If I put the AppleScripts in files to make it modular, then it has to
>
>open all the files which makes it slow. From within QuicKeys you can
>
>call multiple AppleScripts but not pass data between them. So,
>
>writing monolithic applescripts are about the only way to do it.
>
>
You can present a single script to QK, and be still modular in its internal
>
construction. This is not a problem.
>
>
>
>That's not so bad, but with 12 similar scripts, every time I discover
>
>a non-compliant application, I have to make 12 changes!
>
Then I think you'll prefer the approach I'm talking about.
[much good stuff snipped]
The key thing has doesn't tell you, which is necessary to use this
approach, is that you want to keep most of these wrapper classes for
your application's problem children in a stayopen applet script that
runs on startup.
Put your monolithic script with a pile of complex handlers and script
object wrappers in such a file, and then let the script's you have in QK
call those scripts. Define your functions there, and all the time you
lose is one apple event send to your applet. I do this kind of think as
well using OneClick and have the same problem. I have 36 different
scripts to automatically make different types of boxes in different
strict positions on one of my Quark templates. Instead of installing
the script in OC 36 times, I made it into a handler using parameters to
distinguish the 36 different kinds of calls (among others). Then, only
if the parameters change, do I need to change all 36 scripts. if the
basic script engine has to change, I only need to make one edit.
Just remember that you "tell" your script applet by name or path, just
like any other application. Once you're in it's tell block, you can
access it's handlers and properties. If you want to segment your
namespace further, define script objects within your applet for
different major tasks.
So you can then write scripts like this in QK:
tell application "Macintosh HD:Applications:MyScriptServer"
tell acrobatObject
resizeFrontWindow(windowRect)
end tell
end tell
Michael
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.