• 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: AppleScript in a Run Script Build Phase & User Interaction
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: AppleScript in a Run Script Build Phase & User Interaction
      • From: Eric Gorr <email@hidden>
References: 
 >AppleScript in a Run Script Build Phase & User Interaction (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: SPAM-LOW: Re: Xcode Scripts Menu item examples
  • Next by Date: Re: AppleScript in a Run Script Build Phase & User Interaction
  • Previous by thread: AppleScript in a Run Script Build Phase & User Interaction
  • Next by thread: Re: AppleScript in a Run Script Build Phase & User Interaction
  • Index(es):
    • Date
    • Thread