• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: To OSAX or Not To OSAX?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: To OSAX or Not To OSAX?


  • Subject: Re: To OSAX or Not To OSAX?
  • From: Richard Morton <email@hidden>
  • Date: Tue, 24 Jun 2003 10:47:38 +1000

On Saturday, June 21, 2003, at 11:54 AM, Gary Lists wrote:
Under what circumstances does one decide to go ahead and rely on a call to
an addition instead of perhaps a longer or less elegant, but 'pure', method
that can be achieved with AS standard installed components?

I find this an acceptable solution in many cases:

try
-- osax call
on error
-- vanilla code
end

It slows vanilla execution, but allows for either & means the script will work in any case. You could also check for an osax & then do a whole code block:

try
-- osax call
set haveOsax to true
on error
set haveOsax to false
end

if haveOsax then
-- faster code &/or extra features
else
-- vanilla code, perhaps doing less
end



Especially if a script is intended for distribution.

Perhaps decide what's most important to you - speed or compatibility - and consider the likely configurations &/or skill level of your target market. I tend to use the try/error thing for classic MacOS scripts, but find it preferable to go vanilla with X. I used to use osaxen to bypass the Finder, but it's often much faster in X anyway.


Even if the osax is
freely distributable, but would require an "install" (which, as we know in
this case, means "drop" mostly), do you think users are less likely to give
it a go if they have to "do something" other than double click? (Yes,
obviously, any perceived 'obstacle' is an obstacle, but...)

You could write an installer script. One of the things 'path to' is very helpful for. It does depend on the osax author's distribution requirements though - Chris Hyde (Dialog Director) requires that DD is only distributed in its original form, nearly 1meg of cool stuff for script authors. The osax is a 68 KB file inside the .sit archive. This makes it a bit difficult to distribute with scripts.

At the end of the day it's your call - you're writing the stuff, you have to decide.

Cheers,

Saul Distributor
_______________________________________________
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.

References: 
 >To OSAX or Not To OSAX? (From: Gary Lists <email@hidden>)

  • Prev by Date: Re: Applescript, Panther, and X-Code
  • Next by Date: "enterkey" keystroke and some more basic questions
  • Previous by thread: To OSAX or Not To OSAX?
  • Next by thread: Re: To OSAX or Not To OSAX?
  • Index(es):
    • Date
    • Thread