How to open txt file in a new xCode file

Hello guys!
i´ve a folder populate with .txt files. and i have a ListBox to acces them. What i want is to make a double click and open the file in a xcode tab. what is the function to do that?

I mean, i current have a ofFile and a path. i dont match with the function to Open a ofFile in a xcode file (externally of the app)

I would like to help, but this question is unclear.

usually the .txt files or whatever is into your app /data folder is not included into the project structure to look into.
you can use an external text editor to look into.

What i need is to execute a external file using openframeworks. Lets say i have a button, and when i click it a .txt file (already create and in a folder) is execute (lets say in xCode, or in other programe)
I`ve been investigated ofSystem, but no result yets.

do you mean to trig to open the file.txt in an external editor (that will open the file)?

you can try to build a system command like in the example:


// create the command
string cmd = "say " + words[step] + " ";
// print command and execute it
cout << cmd << endl;

But I don’t know where to look at possible commands.

I never tryed it, but I have seen an addon that seems to can do that:

openFile(string path) Opens a file with the default application

ofSystem("open get_started.c -a XCode") works on my OSX.
It will open as an Xcode window, not a tab in your project.
(Have tried it with Terminal, not ofSystem)

1 Like