Created
July 20, 2012 09:05
-
-
Save jianhu/3149740 to your computer and use it in GitHub Desktop.
Revisions
-
jianhu created this gist
Jul 20, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ tell application "Xcode" if (frontmost of it = false) then return end if set documentList to source document of it set listLength to count of documentList if listLength is less than 1 then return --no opened source file in working space end if set filePath to path of item listLength of documentList -- get the last one set filePathStr to filePath as text if (filePathStr ends with ".m" or filePathStr ends with ".h") then --only format source file do shell script "uncrustify -c ~/.uncrustify/objc.cfg --no-backup " & filePathStr -- where the essense resides.. end if end tell