Re: User Scripts problem
Re: User Scripts problem
- Subject: Re: User Scripts problem
- From: Eric Gorr <email@hidden>
- Date: Tue, 19 Aug 2008 13:53:57 -0400
Mike Garcia wrote:
> Ok… I added an AppleScript to switch to the finder and back to
> Xcode after checking the file out. It’s very hokey but it works.
Can you post the working script?
I am having a similar problem, but cannot seem to get it to work
correctly.
The script I have is:
#!/bin/sh
source ~/.bash_profile
SWITCHOUT=`osascript << ENDOFSCRIPT
to getNameOfFrontProcess()
tell application "System Events"
set pairs to {name, frontmost} of every process
end tell
repeat with p from 1 to count item 1 of pairs
if item p of item 2 of pairs then return (item p of item 1 of
pairs) as string
end repeat
end getNameOfFrontProcess
try
set frontProcessName to (my getNameOfFrontProcess())
tell application "Finder"
activate
end tell
tell application frontProcessName
activate
end tell
on error
do shell script ("echo 'error'")
end try
ENDOFSCRIPT`
p4 edit %%%{PBXFilePath}%%%
${SWITCHOUT}
I attempted to put a delay after I switch to the finder and before I
switch back to xcode, but that didn't help. Xcode didn't let me edit
the file I just checked out unless I manually switched to the finder
and then came back.
_______________________________________________
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