Create an automator service for commenting selected code segment


At first my intention was to create an Xcode plugin that helps to comment a selected code segment with C style comment(like /*…*/) with some shortcuts. In current versions of Xcode, if we select a segment and press ⌘ + / then Xcode will comment the selected code segment with // in front of each line. Well, this is easy.. But not so clean, isn’t it? I think So, because if you comment a large number of lines together by putting // in front of each line, it is impossible to fold the commented code. But if you comment with /* … */, its possible to fold the commented code segment.

Ok… lets create an automator service for this. And you can assign  shortcut keys for this service. As a result you can use this service very easily.

Lets Start…

  • Open up automator and select New from file or press ⌘ and…

View original post 236 more words