Re: AppleScript in a Run Script Build Phase & User Interaction
Re: AppleScript in a Run Script Build Phase & User Interaction
- Subject: Re: AppleScript in a Run Script Build Phase & User Interaction
- From: Chris Espinosa <email@hidden>
- Date: Tue, 24 Nov 2009 08:29:39 -0800
On Nov 24, 2009, at 8:20 AM, Eric Gorr wrote: I have an AppleScript that I would like to have executed during a Run Script build phase. This AppleScript contains the line:
set dialogResult to display dialog "Name to use:" default answer "MyName"
For the build phase, I am currently using /bin/sh as the shell and the script is simply:
osascript $SRCROOT/CreateUserFiles
When I run the script, I get the error message:
/Volumes/Depot/EricGsMainWS/Engineering/VectorWorks/TaskBranches/VW16/Cocoa/AppSource/CreateUserFiles:865:955: execution error: No user interaction allowed. (-1713)
Is there a way to have user interaction during a Run Script Build Phase using AppleScript?
If not, perhaps with another scripting language?
Xcode executes Run Script build phases in a subtask that does not have a window server connection, which is why you're getting that error. To do user interaction, you have to message an app that can present UI, such as the Finder or System Events.
Just wrap that line in a 'tell app "Finder"'/'end tell' block.
Chris |
_______________________________________________
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