How to get the path to my app?

(in mac) something like:
of_v0.8.2_osx_release/apps/myApps/emptyExample/bin/emptyExampleDebug.app/Contents/MacOS/emptyExampleDebug

l guess we can find it if we can get the app name?

string appname = ofSystem("ls ./");
string ret = ofSystem("find `pwd` -name " + appname);
vector <string> cleanString;
cleanString = ofSplitString(ret, "\n");
ret = cleanString[0];
	
ofLogNotice("getAppName()") << ret;

this works in mac

you can do:

string appname = ofFilePath::getFileName(ofFilePath::getExePath());
3 Likes

Thanks Arturo!
(Note: i think it might have changed now)

string appPath = ofFilePath::getAbsolutePath(ofFilePath::getCurrentExePath());