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

how to get document name and document color model details

Participant ,
May 18, 2023 May 18, 2023

Copy link to clipboard

Copied

hi all,

 

filename: refresh.mm

 (IBAction)refreshSelectedTab:(NSButton *)sender {

    @try

    {

        callRefresh();

    }

    @CatCH(NSException *err)

    {

        NSLog(@"Err:%@",err.description);

    }

}

the above code i used to refresh the panel after clicking it on refresh button.
the panel i have created using objective-c
so i called  callRefresh(); from objective-c to c++

file name:plugin.cpp

void callRefresh()

{

  RetrieveDocumentDetails();

}

in the above code i have called  RetrieveDocumentDetails(); to retrieve the document name and document colormodel details

 

 

file name:plugin.cpp

ASErr RetrieveDocumentDetails() {

AIDocumentHandle cDocument;

    sAIDocument->GetDocument(&cDocument);

 

ai::UnicodeString documentName("");

sAIDocument->GetDocumentFileName(documentName);

std::string documentFileName = documentName.as_UTF8();

 

ai::int16 documentColorModel=0;

sAIDocument->GetDocumentColorModel(&documentColorModel);

}

 

in the above code i have used to retrieve the document name and color model details..
while retrieving document name and color models details in the function RetrieveDocumentDetails();  that is function called from objective-c to c++ , the details are not getting retrieved .

if i call the function RetrieveDocumentDetails(); without calling it from objective-c , the details will get retrieve..
if call the function RetrieveDocumentDetails(); using objective-c the details are not get retrieving .

please anyone kindly help me to solve this problem...

Thank you

TOPICS
SDK

Views

493

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

correct answers 1 Correct answer

Guide , May 18, 2023 May 18, 2023

You may have a context problem. See this thread for a solution if that's the case:

 

https://community.adobe.com/t5/illustrator-discussions/window-button-and-aishapeconstructionsuite-newrect-function/m-p/10292083

Votes

Translate

Translate
Adobe
Guide ,
May 18, 2023 May 18, 2023

Copy link to clipboard

Copied

You may have a context problem. See this thread for a solution if that's the case:

 

https://community.adobe.com/t5/illustrator-discussions/window-button-and-aishapeconstructionsuite-ne...

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
Participant ,
May 19, 2023 May 19, 2023

Copy link to clipboard

Copied

hi @A. Patterson  thanks for your reply 

it works retrieving details
but crashing while retrieving details

Screenshot 2023-05-19 at 3.33.30 PM.png


is there any solution to solve this

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
Participant ,
May 19, 2023 May 19, 2023

Copy link to clipboard

Copied

LATEST

thank you @A. Patterson  
it really worked.. 

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