Re: Xcode 4 editor scripting - help!
Re: Xcode 4 editor scripting - help!
- Subject: Re: Xcode 4 editor scripting - help!
- From: Brad Oliver <email@hidden>
- Date: Mon, 27 Feb 2012 20:10:43 -0700
On Feb 27, 2012, at 7:00 PM, email@hidden wrote:
> Here's the best approach I've come up with. It works, if you hold your nose, but it's still terrible.
>
> My goal: Insert "->" when Alt+, is pressed.
>
> 1. Use Apple Script Editor to create a .scpt file with the following contents. I called mine "~/bin/Insert Arrow.scpt".
[snip]
Yeah, that won't work for me because my scripts need the contents of the current selection in the front window, and then they act upon that to return an altered chunk of text that is pasted in.
> P.S. When I was looking into this stuff, I also found another method. Here's what I wrote at the time: "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. "
I'd like to hear more. I have yet to figure out how to do anything like replace the current selection. I've tried a bunch of different things in AppleScript, but I can't seem to get them to do anything except return errors. And I'm not married to AppleScript either - if I could do this in any script language, I'd be happy enough.
Finally - and I say this only half-jokingly - if I could get the latest LLVM/Clang to work with the 10.7 SDK in Xcode 3.2.6, that'd be my dream result. ;-)
--
Brad Oliver
email@hidden
_______________________________________________
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