Copy link to clipboard
Copied
Dear Friends,
I have faced a problem while opening a file in Illustrator CC 2017 on MAC X machine.
please see the code below.
AIDocumentHandle document;
AIColorModel colorModel = kAIUnknownColorModel;
AIBoolean forceCopy=false;
const ai::UnicodeString openFilePath("/Users/Admin/Desktop/123.ai");
ai::FilePath path(openFilePath,true);
ActionDialogStatus dialogStatus = kDialogNone;
AIErr error=kNoErr;
error=sAIDocumentList->Open(path, colorModel, dialogStatus, forceCopy, &document);
open() method returns kNoErr,but the document (ai file) is not opened.This is the Problem.
Note that:the same code is working fine in Windows.
please give your suggestion to solve this problem.
Thank you friends,
Nathan.
Copy link to clipboard
Copied
File and folder names are case sensitive on mac and user folder is normally lowercase, so are you sure it shouldn't be "/Users/admin/Desktop/123.ai" ? If the file doesn't open you should get an error returned, so not sure why you are getting kNoErr, did you post your exact code?
Why do you put "Reg:" in front of your questions?
Copy link to clipboard
Copied
Dear Friend,
Thank you for your Immediate reply.
I am sure that I have posted my exact code.
Users Directory in My Machine shows like My code(U in Uppercase) (Please see the attached image).
please note that:open() method returns 0.But the file is not opened in Illustrator.
please give your suggestion.
regards,
Nathan
Copy link to clipboard
Copied
You mentioned in another thread that you were using CC2017.1 -- that's not officially released yet, so I assume that means you're in the pre-release program? If so, you should ask this on the forums there as this could be a bug in the pre-release build.
Copy link to clipboard
Copied
Dear Friend,
Thank you for your Immediate reply.
I mentioned in Save as PDF Thread is illustrator CC(17.1), not CC 2017.1. Please see the below Image.
But sAIDocumentList->Open problem occurs in CC 2017(21.0.2). With MAC OS.
please give your suggestion to solve this Problem.
Regards,
Nathan.
Copy link to clipboard
Copied
When you open the 123.ai file in Illustrator on Mac, do you get any popup dialogs?
Copy link to clipboard
Copied
Dear Friend,
There is no popup dialogs shown at the time of Openning 123.ai File in Illustrator on Mac.
Thank you Friend,
Nathan
Copy link to clipboard
Copied
How do you know that sAIDocumentList->Open returns kNoErr? Do you output a debug string to stdout/stderr? Do you check the value in the debugger?
Copy link to clipboard
Copied
Dear Friend,
Thank You For Your Immediate Reply.
I Run My Plugin code With Attach to Process(Xcode ->Illustrator).
Copy link to clipboard
Copied
Ok, that's good as it means you are definitely running the version you have built.
Is this code called when you get a plugin message or from a callback? If it is from a callback, are you setting the AppContext?
Copy link to clipboard
Copied
Dear Friend,
This code is called when i get a plugin message.
I am trying to open a File in CheckMe Menu item of MenuPlay Project(SampleCode in Illustrator SDK).
See the Image shown below.
Please give your suggestion,
Thank you Friend,
Nathan.
Copy link to clipboard
Copied
I tried using your code in the MenuPlay sample on Mac and it worked fine for me. The only thing I would change would be to initialise document:
AIDocumentHandle document = NULL;
But I don't think this will fix your problem.
The only other possible reason I can think of why it wouldn't work on your machine would be if you have some other plugin that says that it can open AI files. Have you installed or built any other plugins on your mac?
Copy link to clipboard
Copied
Dear Friend,
Thankyou for your suggestion,
I have tried with AIDocumentHandle document = NULL to initialize the document.
but the problem is not solved.
And There is no other plugins in My Mac Machine.
regards,
Nathan