If I want something to happen with a file after I save it in Xcode 4, is there any way I can achieve that? Say I want to replace all occurrences of “a” with “b” in the file after saving it.
Can this be done using the Automator? Or any other way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This requires file/directory observation:
You could either use an Objective-C wrapper for FSEvents, such as SCEvent
Or you could use Uli Kusterer’s UKKQueue, which is an Objective-C wrapper around the kqueue file change notification mechanism.
Similarly to UKKQueue there exists Google’s GTMFileSystemKQueue which as well is an Objective-C wrapper around kqueues.
In short:
To get an xcodeproj’s files (which you then want to observe) parse its internal xml content tree.