Register FAQ/Rules Forum Spy Search Today's Posts Mark Forums Read

Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate.

 
Go Back   Mac Forums > Apple Software > Mac Programming
TouchArcade.com - iPhone Game Reviews and News

Reply
 
Thread Tools Search this Thread  
Old Jun 22, 2008, 06:21 AM   #1
bengimizrahi
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?
bengimizrahi is offline   Reply With Quote
Old Jun 22, 2008, 01:40 PM   #2
Catfish_Man
macrumors 68020
 
Catfish_Man's Avatar
 
Join Date: Sep 2001
Location: Portland, OR
Send a message via AIM to Catfish_Man
Not that I'm aware of, but that's a good idea
Catfish_Man is offline   Reply With Quote
Old Jun 22, 2008, 04:31 PM   #3
Sayer
macrumors 6502a
 
Sayer's Avatar
 
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
Sayer is offline   Reply With Quote
Old Jun 22, 2008, 05:33 PM   #4
Eraserhead
Contributor
 
Eraserhead's Avatar
 
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 is offline   Reply With Quote
Old Jun 22, 2008, 05:54 PM   #5
Mac Player
macrumors regular
 
Join Date: Jan 2006
You might want to give a look at TextMate's Objective-C bundle scripts.
Mac Player is offline   Reply With Quote
Old Jun 23, 2008, 12:54 AM   #6
bengimizrahi
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.
bengimizrahi is offline   Reply With Quote

Reply

Mac Forums > Apple Software > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:05 PM.

Mac News | Mac Rumors | iPhone Game Reviews | iPhone Apps

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2002-2009, MacRumors.com, LLC