Adequate substitutes for Xcode 3's script menu?
Adequate substitutes for Xcode 3's script menu?
- Subject: Adequate substitutes for Xcode 3's script menu?
- From: Tom Seddon <email@hidden>
- Date: Sun, 29 Jan 2012 21:25:39 +0000
What are people using in Xcode 4 as a substitute for simple insert-bits-of-text scripts accessed via Xcode 3's user script menu? I have a number of little macro-like things, that I've been using for a few years now across a number of different text editors, that just insert tiny bits of code. So I press Alt+, to insert "->", that kind of thing. This is very easy to set up in every other text editor I've used, including Xcode 3, but it's surprisingly hard in Xcode 4.
I've tried to create a service using Automator, by recording me typing (say) "->" into Xcode. But when I run the resulting service, I get a "Failed to write output" error when it tries to insert the text, and nothing happens.
I tried creating a new Xcode Behaviour that runs a script that does "echo -n -\>", but the output from the script doesn't get inserted into the document.
Code snippets don't work very well for short expansions like "->", though for longer ones I can see them being useful enough.
I managed to create an Xcode Behaviour that runs a script that uses osascript to run an apple script that uses the "keystroke" command to insert keys, but this falls foul of my sometimes not releasing the modifier key in time. Using "delay" to delay the start of the script is suitable for only some of my macros.
I also figured out that one can create an Xcode-specific service that runs a script that replaces the current selection, and have it do an echo -n. That does what I want too, but the choice of keyboard shortcuts is limited (e.g., M-, doesn't seem to work as a shortcut for a service), and the output takes so long to appear - probably at least 1/4 sec - that it hardly seems worth the bother for the shorter bits of text.
So that's 2 ugly solutions that I can maybe make work the way that I would like... I can't help thinking that it should be a bit easier and/or neater than this. Does anybody have any other suggestions, that ideally work better than what I've managed to come up with?
Thanks,
--Tom
P.S. radar issue #10596415.
_______________________________________________
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