• 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: Getting "stdout" of an app launched by XCode through AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting "stdout" of an app launched by XCode through AppleScript


  • Subject: Re: Getting "stdout" of an app launched by XCode through AppleScript
  • From: Scott Thompson <email@hidden>
  • Date: Thu, 17 Jul 2008 11:26:47 -0500


On Jul 17, 2008, at 11:13 AM, Kevin Cathey wrote:

Phillip,

Actually, Phillip replied.  I was the OP. :-)

This is actually surprising easy. What you need to do is get the project you want to build. You can get this by either passing in a name, or getting a list of the open projects and choosing from there. Then, you need to make sure that project is open, that's as simple as:

open theProjectPath

Then, once the project is open, to build the active target, and if it succeeds, run the built executable, your AS will look something like this:
tell theProject
set theBuildResult to build
if theBuildResult starts with "Build succeeded" then
launch
end if
end tell

That should do it.

OK... but the "launch" call causes the executable to run.  What I want to do is capture the output generated by the executable and use it back in the AppleScript world.

Phillip's suggestion was to drop down to a shell environment and use the "open" shell command to open my application.  Unfortunately, this is not an option.  My application will not execute from "open", it has to execute from XCode.

I'd like to do (using your example as a shell)

if theBuildResult starts with "Build succeeded" then
set theExecutablesOutput to launch
end if

But the results of the "launch" event is not the output of the program.

My hope is that XCode is recording the output of the program in some "well-known location" that I can grab and read.  I need to know what that well-known location is though.

Scott

 _______________________________________________
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: Getting "stdout" of an app launched by XCode through AppleScript
      • From: Philip Aker <email@hidden>
References: 
 >Getting "stdout" of an app launched by XCode through AppleScript (From: Scott Thompson <email@hidden>)
 >Re: Getting "stdout" of an app launched by XCode through AppleScript (From: Kevin Cathey <email@hidden>)

  • Prev by Date: Re: "Ghost" files in SCM Results
  • Next by Date: Re: Getting "stdout" of an app launched by XCode through AppleScript
  • Previous by thread: Re: Getting "stdout" of an app launched by XCode through AppleScript
  • Next by thread: Re: Getting "stdout" of an app launched by XCode through AppleScript
  • Index(es):
    • Date
    • Thread