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

WriteDocument SVG not working when debugging

New Here ,
Jan 29, 2015 Jan 29, 2015

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

TOPICS
SDK
760
Translate
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 ,
Jan 29, 2015 Jan 29, 2015

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?

Translate
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
New Here ,
Jan 29, 2015 Jan 29, 2015

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?


Translate
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
New Here ,
Jan 30, 2015 Jan 30, 2015

This might be important info add:

Adobe Illustrator CC SDK Build 18.7.0

Xcode 6.1

Adobe Illustrator 18.1.1

Translate
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
New Here ,
Feb 09, 2015 Feb 09, 2015
LATEST

I have isolated the problem somewhat. I think it is a bug, maybe someone can try to reproduce this?

  1. Open one of the examples provided as part of Adobe Illustrator CC 2014 SDK (I used annotator).
  2. Make sure AI CC 2014 is loading the samples.
    1. In AI CC 2014 preferences, go to "Plugins & Scratch Disks"
    2. Check additional Plugins Folder
    3. Choose the dir in which the sample project will be build: [...]SDK/samplecode/output/mac/debug
  3. In Xcode (6.1), Product -> Scheme -> Edit Scheme.
  4. Select Run (debug) and use the following settings:
    1. build configuration: debug
    2. executable: Adobe Illustrator CC 2014.app
    3. check debug executable
  5. Product -> Run
  6. Now, Xcode will debug the sample in AI.
    1. Create a new document
    2. File -> Save as..
    3. Choose SVG as the format and click save.
    4. A Dialog will appear, keep the default settings and click Save.

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


Translate
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