Skip to main content
Participating Frequently
November 15, 2010
Question

get application path directory

  • November 15, 2010
  • 1 reply
  • 1517 views

hy,

i'm trying to create a plug-in that run an application located in the same directory of the plug-in file.

If i do

system("./Rec.app/Contents/MacOS/AlbumExpressRecord");

the application search the file in my home directory.

Is there a function in the SDK that say me wath is the path of Photoshop directory???

Thank you

This topic has been closed for replies.

1 reply

ilvar
Inspiring
November 15, 2010

sSPPlugins->GetPluginFileSpecification(pluginRef, &outFileSpec) from SPPluginsSuite is probably what you are looking for

Participating Frequently
November 16, 2010

hy thank you for your asnwer.

i do this things:

I take the Dissolve project.

Modify the "PluginMain" adding:

    SPPluginsSuite* sSPPlugins;
    // Use the Basic Suite as describe in the chapter of that name
    // and to acquire the suite
    SPErr error = sBasic->AcquireSuite( kSPPluginsSuite, kSPPluginsSuiteVersion, &sSPPlugins );
    if ( error ) goto error;
    sSPPlugins->GetPluginFileSpecification(pluginRef, &outFileSpec);

and including at the top

     #include "SPPlugs.h"
     #include "SPAdapts.h"

but i've many compilation error.

1) sBasic is not declarated in this scope

2) pluginRef was not declered in this scope.

What can i do? What is my pluginRef?

Thank you!

Participating Frequently
November 16, 2010

I hope you can help me becouse  this plug-in is very simple, it must execute a file in the same  directory where the plugin is installed.

If i execute system("./Appname.app/Contents/MacOS/AppName"); the plugin search in my home directory (on windows and on MacOS).


i try to write:

     SPPluginsSuite* sSPPlugins;
        
     SPPluginRef fPluginRef = message->d.self;


    SPPlatformFileSpecification filespec;
    
     sSPPlugins->GetPluginFileSpecification(message->d.self, &fileSpec);
    
     filespec.mReference
    
     ai::FilePath path(platformFileSpec);
     std::cout << path.GetFullPath().as_Platform() << std::endl;

but i have several errors.

Thank you