Reputation: 2746
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!
Upvotes: 4
Views: 5424
Reputation: 304
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
Upvotes: 0
Reputation: 133189
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.
Upvotes: 3
Reputation: 63707
See https://devforums.apple.com/message/380673#380673 for an answer.
Upvotes: 0