Re: Xcode & Automator
Re: Xcode & Automator
- Subject: Re: Xcode & Automator
- From: Matt Neuburg <email@hidden>
- Date: Fri, 16 Sep 2005 06:55:34 -0700
On Wed, 14 Sep 2005 15:09:01 -0700, "Timothy J. Wood" <email@hidden>
said:
>
>On Sep 14, 2005, at 10:57 AM, Mark Bessey wrote:
>> I think this is difficult because you have a circular dependency -
>> the application can't be built without the actions, and the actions
>> can't be built before the application is built. With Xcode,
>> solutions to these sorts of issues almost always end up involving
>> another target and a Copy Files or Run Script build phase in some way.
>
> I logged this issue in Radar with some details on how we do this
>now and a suggestion that maybe osacompile would not launch the
>target application
Basically what you're complaining of is that AppleScript needs a dictionary
in order to compile a script. It is certainly true that one annoying thing
is AppleScript needs this dictionary to be in an application. You'd think
that you could just point it at the dictionary and say "use this".
The launch problem is not the same, though. The launch problem is because in
Cocoa Scripting there is no fixed dictionary. The application announces that
its dictionary is dynamic. Therefore the dictionary must be running so that
the aete-formatted dictionary can be formed.
On the other hand, if a dictionary is in a fixed aete resource, the app has
no need to launch in order for its dictionary to be retrieved. This is the
way almost *all* applications used to work in OS 9 and before (except for
BBEdit, whose dictionary is dynamic).
So one solution would be to build the dictionary into an aete resource
(using sdp) and start by building some *other* application that uses this
dictionary. The other application would have no functionality; its sole
purpose is to allow your scripts to compile. Use a "using terms from" block
to force your scripts to seek their terminology in this other application;
this is solely for purposes of compilation and will have no effect on your
scripts once they are compiled. Actually you could go even further: give the
other application the very same name as your app, and start it up before
beginning the compilation process. Then you wouldn't need the "using terms
from" block at all. AppleScript will see the running app and use it to
resolve terminology under that app name. Since the terminology is the same
as that of the app you are about to build, when the user gets hold of that
app and the scripts that refer to it, and since the name is the same,
everything will just work. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden