Re: Applescript
Re: Applescript
- Subject: Re: Applescript
- From: Thaddeus Cooper <email@hidden>
- Date: Mon, 25 Oct 2004 11:21:35 -0700
Thanks to all who responded. Chris is quite right in assessing what I
was trying to do. After much head-banging last night (there's a nice
dent in the wall of my office) I finally figure out how to do what I
was trying to do, which is what he suggested. It's just not obvious
that to run an AppleScript as part of a target this doesn't work:
#!/usr/bin/osascript -lAppleScript
tell application "Some App"
do stuff
end tell
Instead you have to do this:
#!/bin/sh
/usr/bin/osascript -lAppleScript yourAppleScript
And inside youAppleScript put the actions you need performed.
--Thaddeus O. Cooper
(email@hidden)
On Oct 25, 2004, at 11:00 AM, Chris Espinosa wrote:
On Oct 24, 2004, at 10:29 PM, Larry Fransson wrote:
Is there a way to have an AppleScript run as part of a targets build
phase?
Do you mean something like Project -> New Build Phase -> New
AppleScript Build Phase?
That's not what he wants. The AppleScript Build Phase compiles
AppleScripts into compiled scripts in your project; it doesn't execute
them as part of your build.
The best way to incorporate AppleScript execution into your build is
via a Shell Script build phase that executes either the 'osascript'
command (to compile and execute a script) or 'open -a foo.app' command
to execute a compiled AppleScript applet.
Note that AppleScript is primarily intended to send messages to
running user applications, and it can interact with the user, so it
usually requires a Window Server connection. This means that an
AppleScript executed during a build will work when the build is
initiated from the Xcode IDE, but possibly not when it's initiated
from the command-line 'xcodebuild'.
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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