Note that there are some explanatory texts on larger screens.

plurals
  1. POPath to Resources folder in plugin on OS X
    text
    copied!<p>I'm writing a FileMaker Pro plugin for OS X, and I need to be able to access a file in the <code>/Applications/FileMaker Pro 11/Extensions/blah.fmplugin/Contents/Resources</code> directory. (But this could be <code>/apps/FileMaker Pro 11 Advanced/Extensions/xyz.fmplugin/Contents/Resources</code> or something else, depending on where the user installed FMP and whether they renamed the plugin etc.) Since I can't control where the user has installed FMP, or whether they are running FMP or FMPA or whether they have renamed my plugin (although this is less likely than the FMP vs FMPA situation), I <strong>do not</strong> know the path to the plugin's bundle.</p> <p>I've found answers like this: <a href="https://stackoverflow.com/questions/516200/relative-paths-not-working-in-xcode-c">Relative Paths Not Working in Xcode C++</a> but that gives me the path to the Resources folder in the FileMaker.app instead of in my plugin.</p> <p>i.e. I get <code>/Applications/FileMaker Pro 11/FileMaker Pro.app/Contents/Resources</code> instead of the path to the Resources folder in my plugin.</p> <p>Is there something I need to configure in Xcode to get the above solution to work? Or is there some other way to get at the path? The CFBundleGetMainBundle() call makes it sound like it is meant to return the bundle of the app itself rather than the plugin.</p> <p>I have found some possibilities based on the Bundle Programming Guide and CFBundleGetBundleWithIdentifier (mentioned by mipadi), but I haven't been able to figure out yet exactly what functions I need and what the prerequisites are.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload