Copy link to clipboard
Copied
Hi,
I am trying to save a file as svg (silently in the background), by doing the following:
ai::FilePath svgFile;
err = sAIFilePath->NewFilePath(svgFile);
err = sAIFilePath->Set(ai::UnicodeString("/Users/tom/tmp.svg"), true, svgFile);
err = sAIDocument->WriteDocument(svgFile, kAISVGFileFormat, false);
When running the plugin from Xcode (in debug mode) this isn't working. There are no errors but the svg file stays empty and untouched. If I try to manually "File" -> "Save as" -> "SVG" -> "Save" it shows a dialog with a button "SVG Code...". If I click on it nothing happens! Is the svg feature broken somehow?
Now for the weird part; if I just run Illustrator and use the plugin that way (not in debug mode), none of the above problems occur.
I am totally stuck, any help is greatly appreciated.
Best,
Tom
Copy link to clipboard
Copied
Re: Code doesn't work in debug mode.
When is your code being called? If it is not called directly as a result of a message to your plugin main function, you might need to set the application context.
Re: "SVG Code..." button doesn't do anything.
This button should launch a browser window with the SVG code. Maybe Illustrator cannot find your browser?
Copy link to clipboard
Copied
Leo, thanks for your reply.
I am setting the app context like this:
AppContext appContext(fPluginRef);
That SVG code button usually opens the svg code in my text editor, but not in this case (when running in debug mode out of Xcode).
Note that none of the above issues occur when running AI manually and running the plugin that way. I already checked the build/run scheme and it is the same AI application that is being run.
Any other thoughts?
Copy link to clipboard
Copied
This might be important info add:
Adobe Illustrator CC SDK Build 18.7.0
Xcode 6.1
Adobe Illustrator 18.1.1
Copy link to clipboard
Copied
I have isolated the problem somewhat. I think it is a bug, maybe someone can try to reproduce this?
In my case, this results in a dialog with the message: The operation cannot complete because of an unknown error. [PARM]
Note that the problem only occurs in AI CC 2014. In AI CC it works correctly.
Thanks,
Tom
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more