4

I use XCode for one year, and I made a user script in Python. This script gets the all document, gets the cursor position thanks to %%%{PBXSelectionStart}%%%, does some very useful stuff, and replaces all the current document, without moving the cursor.

It works fine.

But I upgraded to XCode 4 and it's seems that the user scripts are not supported! How can I continue to use my script ?

(I try with automator but I can't use the %%%{PBXSelectionStart}%%% variable for the cursor position and I must select all the document in XCode...)

Thanks in advance!

1
  • @PaulR: Nice comment, but now obsolete :-P Commented Mar 31, 2011 at 13:25

3 Answers 3

3

Yes, it seems like Apple dropped user script support :-( The only thing you can do is (from the Apple Developer Forum):

Your only option is to drop it in ~/Library/Scripts and then go to File > Services > Service Preferences... and set a keyboard shortcut.

This works, but is only an inferior replacement, since you won't have all the possibilities you used to have with Xcode user scripts in Xcode 3 :-(

Here is a post showing you how to create an Automator Action which you can use as a service in Xcode (via the service menu and assign a shortcut as mentioned above). I did that as well (modifying one of my scripts to read input from stdin and write output to stdout) and it works... as I said above, it is rather limited and it is ten times slower than it used to, but better than nothing.

Sign up to request clarification or add additional context in comments.

Comments

0

See https://devforums.apple.com/message/380673#380673 for an answer.

2 Comments

Of course, those of us who aren't registered developers can't see this…
It's copy pasted in the answer above, it was on NDA at the time.
0

I ran into this same issue and put together a wrapper script that allows Xcode 4 to run Xcode 3 user scripts.

It works by replacing the old style %%%{PBXFilePath}%%% variables in your scripts with values gleamed from Xcode 4 via AppleScript.

Its available on GitHub. https://bitly.com/HXHiij

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.