0

I installed Uncrustify as per the instructions here:

http://noiseandheat.com/blog/2012/01/uncrustifying-objective-c-source-in-xcode-4/

Used brew for installation and added new behavior in Xcode(4.3.2) preferences.

However running the behavior from the menu does nothing. What might I be missing?

NSExplorer
  • 11,849
  • 12
  • 49
  • 62

2 Answers2

2

For me https://github.com/tonyarnold/Xcode-4-Uncrustify-Automator-Services worked : Automator is used to create a workflow, which will be available in Xcode to format the selected code (The link above could describe a better way - I am just saying what worked for me...)

1

Thanks Thomas, resource provided by you was very useful and allowed me to add automator workflows into Xcode. Only problem is that script "Uncrustify Document then Re-Indent" is showing an error "System Events got an error: Access for assistive devices is disabled". Initially I sudo touch /private/var/db/.AccessibilityAPIEnabled to enable assistive devices but this did not help. I found a thread on similar issue here: AppleScript - System Events Error : Access for assistive devices is disabled

fanaugen says:

The problem is not the assistive devices. AppleScript seems to incorrectly return that error code when it tries to access windows of a process that can never have any windows

and he suggest to rewrite script with some changes. I am not sure if it is actually the same issue here and it's first time I am having to deal with this type of script, so I am lacking of knowledge here. Do you have any advice? Did you have a similar issue?

Community
  • 1
  • 1
Justas
  • 136
  • 7
  • I have switched "Enable access for assistive devices" on and off multiple times and it looks like Uncrustify Document then Re-Indent workflow started to work. I am not sure why it did not work first few time I did this, but it could be useful for you to try out doing the same if you have similar issue on your machine. For additional information OS X 10.8.4 and Xcode 4.6.3 was installed on my machine at the moment I was having this issue. – Justas Aug 02 '13 at 07:34