Thank you, squarqDev and Charles! I’ll give sed/awk a go!

Quincey, your responses are normally very helpful, so I’m sorry I picked an 
example that bothered you. It’s not that it’s too much trouble for me to 
manually fix a typo like “let half = numerator /2”; I just wanted a completely 
innocuous example that wouldn’t open up a debate leading to unhelpful noise 
like “your formatting ideas are stupid, so clearly you don’t need the formatter 
you’re looking for.”

However, considering that the compiler allows “let half = numerator/2,” 
complaining about the spacing in my example is either an inline compiler bug or 
someone at Apple just being an ass. If spaces are optional, then either space 
should be optional. There is no unary division operator to create any possible 
confusion about what the statement means. (And if I create my own unary 
division operator to do some insane thing, then I get what I deserve, right?)

-- 

Charles

On January 15, 2016 at 05:40:11, sqwarqDev (sqwarq...@icloud.com) wrote:

> On 15 Jan 2016, at 03:36, Charles Jenkins <cejw...@gmail.com> wrote:
>  
> there’s no way for the end user to create them.


A combination of AppleScript, sed and awk will pretty much do anything you can 
imagine in terms of text formatting, and they’re all included on you mac 
already; no need for 3rd party apps.

With a project and source document already open, doing this in the 
(Apple)Script Editor will get your code into the editor, where you can then 
transform it any way you like before sending it back:


tell application "Xcode"
tell source document 1
set _sourceCode to contents

-- do shell script ....//do all your formatting here



-- replace the original code with your formatted changes
set contents to _sourceCode
end tell
end tell



Best


Phil
@sqwarqdev
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/cejwork%40gmail.com

This email sent to cejw...@gmail.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to