Running Uncrustify by selecting Behavior in Xcode does nothing

782 views Asked by At

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?

2

There are 2 answers

1
Justas On BEST ANSWER

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?

0
Thomas Schumacher On

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...)