Skip to main content
2007ay
Known Participant
July 1, 2013
Answered

How to get the path of placed plugin location

  • July 1, 2013
  • 1 reply
  • 1377 views

hi all,

I want to get the path of my placed plugin location in my custom plug-in code.

supporse my custom plugin at :

C:\Program Files\Adobe\Adobe Illustrator CS5.1\Plug-ins\MyCustomPlugin\MyCustomPlugin.aip

Is any API is there that can tell me my plugin path or the Directory path.

Regards

Ashish.

This topic has been closed for replies.
Correct answer A. Patterson

Yes, what you want is in SPPlugs.h, found in the pica_sp folder. Specifically, you want GetPluginFileReference(), which takes an SPPluginRef, which can be found in any message sent to the plugin. There's always a member of any message:

SPMessageData d;

In that (SPMData.h, also in the pica_sp folder), you'll find:

struct SPPlugin* self;

That's what you pass to GetPluginFileReference(). The result will be placed in a SPPlatformFileReference, which you can pass to the constructor of an ai::FilePath (IAIFilePath.hpp in the main SDK folder) and then you'll have a fairly friendly object from which to pull the full path.

1 reply

A. Patterson
A. PattersonCorrect answer
Inspiring
July 2, 2013

Yes, what you want is in SPPlugs.h, found in the pica_sp folder. Specifically, you want GetPluginFileReference(), which takes an SPPluginRef, which can be found in any message sent to the plugin. There's always a member of any message:

SPMessageData d;

In that (SPMData.h, also in the pica_sp folder), you'll find:

struct SPPlugin* self;

That's what you pass to GetPluginFileReference(). The result will be placed in a SPPlatformFileReference, which you can pass to the constructor of an ai::FilePath (IAIFilePath.hpp in the main SDK folder) and then you'll have a fairly friendly object from which to pull the full path.

2007ay
2007ayAuthor
Known Participant
July 5, 2013

hi,

Thank a lot now i am able to get my config.xml file.

for reading this xml file i am using msxml6.lib .

but facing a lot of problem in string conversion .

can you tell me please is any api provide by AI so i can load it and process this.

one thing more i dont want to load my xml as part of document . i want to load this individaul object or file.

Regards

ashish

A. Patterson
Inspiring
July 5, 2013

ai::UnicodeString (IAIUnicodeString.h) has a bunch of constructors & options for loading strings. That's your best bet. Otherwise you may just need to look for some stdlib sample code to convert before passing it to ai::UnicodeString.