Re: Applescript: Xcode's "front" project is not one in front window
Re: Applescript: Xcode's "front" project is not one in front window
- Subject: Re: Applescript: Xcode's "front" project is not one in front window
- From: Jerry Krinock <email@hidden>
- Date: Fri, 22 Sep 2006 14:55:07 -0700
- Thread-topic: Applescript: Xcode's "front" project is not one in front window
Title: Re: Applescript: Xcode's "front" project is not one in front window
on 06/09/22 11:29, Gouri Jonnalagadda at email@hidden wrote:
Sorry I replied to the wrong question with this answer:
tell application "Xcode"
get name of front window
end tell
tell application "Xcode"
get name of project 1
end tell
tell application "Xcode"
get name of every project
end tell
Gouri
Thanks, Gouri. I still don’t understand why “front project” does not give me the project which is the subject of the front window. “front project” seems to give the same as “project 1”. But, anyhow, here is the ugly workaround. It relies on the fact that Xcode names its windows like “aFilename – aProjectName”:
tell application "Xcode"
set frontWindowName to name of front window
set AppleScript's text item delimiters to " - "
set phrases to frontWindowName's text items as list
-- restore delimiters to default value:
set AppleScript's text item delimiters to {""}
set frontProjectName to item 2 of phrases
set numberOfProjects to count of items of projects
repeat with i from 1 to numberOfProjects
set currentProject to item i of projects
if name of currentProject is frontProjectName then
tell currentProject to [do whatever you want]
end if
end repeat
end tell
_______________________________________________
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