|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
macrumors newbie
Join Date: May 2008
Location: Istanbul
|
How to open 'square brackets' in XCode faster?
Is there a macro that opens square brackets in XCode?
For example, suppose that my cursor is at <cursor> in the following code: [foo method]<cursor>; And after a key shortcut I get the following code: [[foo method]<cursor>]; Is this possible? |
|
|
|
|
|
#2 |
|
macrumors 68020
|
Not that I'm aware of, but that's a good idea
|
|
|
|
|
|
#3 |
|
macrumors 6502a
Join Date: Jan 2002
Location: Austin, TX
|
There is an integrated scripting utility that lets you write complex scripts and assign them shortcut key combos in Xcode. Unfortunately I am poolside with my work DELL Craptop so I can't go through the motions.
Basically anyone good with shell scripting should be able to make or adopt an existing shell script to put an open [ at the beginning of the current line and/or selection and put a closing ] at the end of the line.
__________________
Obama Joker = RACIST :: Bush Joker = Political Commentary Obama Bows to world leaders that violate 200+ years of protocol: 2 |
|
|
|
|
|
#4 |
|
Contributor
Join Date: Nov 2005
Location: Oxford, UK
|
^^ That's not exactly what you want, you want it to put it at the beginning of the current [] block...
|
|
|
|
| Eraserhead |
| View Public Profile |
| Find More Posts by Eraserhead |
|
|
#5 |
|
macrumors regular
Join Date: Jan 2006
|
You might want to give a look at TextMate's Objective-C bundle scripts.
|
|
|
|
| Mac Player |
| View Public Profile |
| Find More Posts by Mac Player |
|
|
#6 |
|
Thread Starter
macrumors newbie
Join Date: May 2008
Location: Istanbul
|
Hmm. The scripting cabability XCode provides appears to be too heavy for such a small task. What do you think? We have to write a (say, python) script that takes the whole text file as input, right? And I guess we need two things: 1. Get the current location of the cursor, 2. Change the current location of the cursor.
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|