简体   繁体   中英

Open a file type in Mac with a custom command

I am currently grading for a C++ class and want to be able to download all the files my students submit and when I click on them they open in Geany so I can compile them really quickly and run them.

When I ran linux I used Geany as my preferred IDE. I've switched to Mac and installed Geany via MacPorts. I currently run Geany by opening a terminal and calling it.

Is there a way to specify a custom command for a file type or will have to build an application to run Geany. Also how do I do that. I tried messing around with automator and applescripts, but couldn't get very far.

I believe this is what you want

Use Applications -> Automator -> Application -> Run Shell Script

Change the "Pass input" to "as arguments"

Change the

 echo $f

to the full path to your geany executable. Leave the $f

 /the/full/path/to/geany $f

Save the Automator app. Give it a name you like.

selecting Get Info (⌘I) in the Finder, and then setting Open with: to Geany and clicking the Change All... button. If that doesn't work I'll need to look into it further.

Source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM