• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Opening file relative to aip

Explorer ,
Feb 28, 2018 Feb 28, 2018

Copy link to clipboard

Copied

The answer to this may be an obvious one, but I can't seem to work it out.

I'm using an ifstream to open an xml file in my plugin. To get it to work, for the time being, I've passed the absolute path of the xml to the ifstream when opening it.

What I really want to be able to do is distribute the xml file, so an absolute path is obviously a no go. Now, when I run the aip in debug (I've got illustrator as my start up program in Visual Studio), the working directory is the location of my visual studio solution. If I start illustrator normally, the working directory is the location of the illustrator exe. So what I want to be able to do is pass a path relative to the aip that's currently loaded. Is this possible?

Is there an easy way of getting hold of the aip directory? Or setting the working directory to be that?

Preferably I would like a cross platform solution, as I would like to be able to deploy this on Mac OS with as few tweaks to the code as possible.

Many thanks in advance

TOPICS
SDK

Views

532

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Advocate ,
Mar 01, 2018 Mar 01, 2018

Copy link to clipboard

Copied

You can use AIFoldersSuite::FindFolder with folder type of kAIPluginsFolderType to get the plugins folder.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 17, 2018 Apr 17, 2018

Copy link to clipboard

Copied

LATEST

I package a text data file with the resources in my aip file. That might be helpful for you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines