Re: Migrating scripting additions to Mac OS X
Re: Migrating scripting additions to Mac OS X
- Subject: Re: Migrating scripting additions to Mac OS X
- From: Jolly Roger <email@hidden>
- Date: Tue, 26 Jun 2001 12:12:52 -0500
On 6/26/2001 8:44 AM, "JJ" <email@hidden> wrote:
>
> making some scripting additions into apps is a
>
> ridiculous way of making AppleScript more tortuous to learn and use than it
>
> is already
>
>
Why?
>
Look at this I.e. (it's easy)
>
>
tell app "Quark"
>
tell document 1
>
tell paragraph i of selection
>
set the_word to word 1
>
tell app "Akua Sweets"
>
set new_word to (transcribe the_word as upper cased)
>
tell app "Finder"
>
set the_store to alias "HD:myfile"
>
tell app "Jon's Commands"
>
if fileIsBusy the_store = false then
>
tell app "Finder"
>
write new_word to the_store
>
end tell
>
end tell
>
end tell
>
end tell
>
end tell
>
end tell
>
end tell
*sigh* I just love it when people try to exaggerate a problem in an attempt
to prove a pointless point.
"alias" is not a Finder class - no need to enclose that in a tell block
"write" is not a Finder command - no need to enclose that in a tell block
"transcribe" is the only Akua command you are using - use a single-line tell
- no need to use tell / end tell
Note that the bulk of your tell statement nesting is due to the fact that
Quark requires that arrangement (or does it really? ;), NOT due to the fact
that scripting additions have become applications, as you seem to imply.
Here is your script written more sensibly, referencing Akua Sweets and Jon's
Commands as applications:
-- begin script
tell application "Quark"
tell document 1
tell paragraph i of selection
set the_word to word 1
tell application "7Akua Sweets" to set new_word to (transcribe
the_word as upper cased)
set the_store to alias "My Stuff:test file"
tell application "Jon's Commands" to set isBusy to fileIsBusy
the_store
if not isBusy then
write new_word to the_store
end if
end tell
end tell
end tell
-- end script
Let's see what happens when we change back to referencing Akua Sweets and
Jon's Commands as scripting additions:
-- begin script
tell application "Quark"
tell document 1
tell paragraph i of selection
set the_word to word 1
set new_word to (transcribe the_word as upper cased)
set the_store to alias "My Stuff:test file"
if not (fileIsBusy the_store) then
write new_word to the_store
end if
end tell
end tell
end tell
-- end script
Surprisingly little has changed. Thanks for helping to prove my point.
Look, let's clear this up. I never said that all scripting additions should
be converted to applications. Obviously there are good reasons for some
(not all) scripting additions to populate the global namespace. And yes,
there are some benefits to packaging an extension as a scripting addition
over an application. There are also lots of benefits to packaging them as
applications. Unfortunately, packaging them as applications is a viable
alternative that nobody but me seems to be open to exploring. I find that
very interesting.
Let's wrap this thread up now. It's gone far beyond the scope of the list
anyway.
Thanks.