Re: Can any AppleScript become a Cocoa App in Xcode?
Re: Can any AppleScript become a Cocoa App in Xcode?
- Subject: Re: Can any AppleScript become a Cocoa App in Xcode?
- From: Philip Aker <email@hidden>
- Date: Tue, 11 Dec 2007 20:12:01 -0800
On Dec 11, 2007, at 2:30 PM, Justin Laden wrote:
Can any AppleScript become (easily or not, and this is something I
would enjoy responses to as well) a Cocoa application if copied and
pasted into Xcode?
Depends on what you've been doing. In AppleScript Studio, the
AppleScript used is a variant or dialect of plain vanilla
AppleScript. Not too far removed but there are a few common cases
that you should be aware of:
1. Watch out for where you've been using a POSIX cast. Instead use '…
as POSIX file'
2. It's generally better to place calls to other apps in a separate
script and load them separately (vocabulary interference problem).
3. Watch out for 'path to/for resource' calls. Don't get them mixed
up because the Studio version requires you to 'tell some bundle …'.
4. The dialog and alert calls have other options, such as a
completion handler.
As a side note, don't try to put all your UI in one nib. If you are
going to have other windows, put them in separate nibs because Cocoa
nib loading is much slower than Carbon nibs (the mechanism has to
wire up all the connections).
One thing that's real handy is to use the 'defaults' methods for
stashing variables common to different scripts.
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
_______________________________________________
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