• 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: Xcode and applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode and applescript


  • Subject: Re: Xcode and applescript
  • From: Dmitry Markman <email@hidden>
  • Date: Mon, 11 May 2009 08:45:15 -0400

Hi Philip
thanks for the tip
using your example I created working code
--set dep1 to get target dependencies of target1
try
-- set dp to get item 1 of dep1
tell item 1 of target dependencies of target1
set target_list to {target of it}
end tell
end try

interesting that if I uncomment to lines for dep1 and dp
and use 
tell dp

it doesn't work
so in order to get access to the target I must create the list 

thanks




On May 10, 2009, at 11:48 PM, Philip Aker wrote:

On 2009-05-10, at 16:07:08, Dmitry Markman wrote:

suppose I have a project that have 2 targets and first target has second target as a dependency
then when I try to run the following script

set posix_project_t_path to "/Users/dima/Projects/AppleScript/AppleScriptTest/AppleScriptTest.xcodeproj"
set project_t_path to POSIX file posix_project_t_path

tell application "Xcode"
open project_t_path
set my_project to project of active project document
tell my_project
set target1 to target "AppleScriptTest"
end tell
set dep1 to get target dependencies of target1
log (get class of dep1)
log (get length of dep1)
set dp to get item 1 of dep1
log dep1
log dp
end tell

I'm getting an error (at the line "log dp")

There are lots of quirks and bugs in Xcode scripting. Below is the closest I can get without parsing the project file as a plist.

set targ_name to "AppleScriptTest"

-- do shell script "open /Users/dima/Projects/AppleScript/AppleScriptTest/AppleScriptTest.xcodeproj"
set res to {}
tell application "Xcode"
tell project 1
tell target targ_name
set end of res to "TARGET_ID: " & id
tell item 1 of target dependencies
set end of res to "DEPENDENCY_ID: " & id
end tell
end tell
end tell
end tell
res

Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.


Dmitry Markman


 _______________________________________________
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

References: 
 >Xcode and applescript (From: Dmitry Markman <email@hidden>)
 >Re: Xcode and applescript (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Xcode and applescript
  • Next by Date: Re: TextEdit, delete all blank lines
  • Previous by thread: Re: Xcode and applescript
  • Next by thread: Get selected text in Apple Mail?
  • Index(es):
    • Date
    • Thread