objective c - OS X application that can run shell commands -


I tried to ask this question, but they sent me back here.

I have created a custom file association with TextEdit and it is working. Now I have to create an application that is custom to my custom Uses the file association and runs shell command to open non-proprietary applications (such as text edit, VLC, act). This app will be downloaded from the web.

How can I get all this? It can be in any language, but better objective-c

It seems like there is a better way to do this

  [[NSWorkspace sharedWorkspace] openFile: @ "& lt; FULL_PATH_TO_YOUR_ASSOSIATED_FILE & gt;"];  openFile   

for

opens the specified file using the default app related to its type.


The less elegant way to do this is as follows:

Check the status of the open command on your system such as < Use the foundations for the code> whereis open and the executable to change the code

  NSTask * task = [[NSTask alloc] init]; [Work Set Lockpath: @ "& lt; FULL_PATH_TO_OPEN_COMMAND & gt;"]; [Work setAlgatas: @ [@ "& lt; FULL_PATH_TO_YOUR_ASSOSIATED_FILE & gt;"]] ;; [Launch the task];    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -