• 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
setting up "external target" with AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setting up "external target" with AppleScript


  • Subject: setting up "external target" with AppleScript
  • From: Dmitry Markman <email@hidden>
  • Date: Mon, 25 May 2009 00:10:43 -0400

Hi
I just like to share some AppleScript

with help from Philip Aker and Jonas Maebe
I was able to create script that can add to your project external target


set target_name to "my_target_name"
set my_tool_arguments to "<whatever you want>"
set my_module_directory to "<whatever path you want>"
tell application "Xcode"
set my_project to project of active project document
tell my_project
set make_target to target template "Other/External Target"
set my_target to make new target with data make_target with properties {name:target_name}
set active target to my_target
end tell


tell my_target
-- you can set text field directly and not to use build settings. I need it for some other reasons
set value of build setting "TOOL_ARGUMENTS" of every build configuration to my_tool_arguments
set value of build setting "MODULE_DIRECTORY" of every build configuration to my_module_directory
end tell
end tell
tell application "System Events"
tell process "Xcode"
tell menu bar 1
tell menu bar item "Project"
tell menu 1
                         -- Be sure to copy unicode quotes, it's important
set menu_name to "Edit Active Target “" & target_name & "”"
click menu item menu_name
end tell
end tell
end tell
set window_name to "Target: " & target_name
set check_box_name to "Pass build settings in environment"
set need_check_box to checkbox check_box_name of scroll area 2 of splitter group 1 of group 1 of group 1 of splitter group 1 of window window_name
set pass_setting to get value of need_check_box
-- I don't need to pass build settings
if pass_setting is equal to 1 then
click need_check_box
end if
set need_scroll_area to scroll area 2 of splitter group 1 of group 1 of group 1 of splitter group 1 of window window_name
set build_tool_field to text field 4 of need_scroll_area
set args_field to text field 3 of need_scroll_area
set directory_field to text field 2 of need_scroll_area
-- I need to use gmake tool
set value of build_tool_field to "gmake"
-- as I said earlier you can set text field directly and not to use build settings. I need it for some other reasons
set value of args_field to "$(TOOL_ARGUMENTS)"
set value of directory_field to "$(MODULE_DIRECTORY)"


end tell
end tell


Dmitry Markman


 _______________________________________________
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

  • Prev by Date: Re: Project layout...?
  • Next by Date: Can't debug intel target in XCode 2.5
  • Previous by thread: Re: Project layout...?
  • Next by thread: Can't debug intel target in XCode 2.5
  • Index(es):
    • Date
    • Thread