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

Problem in PutFileDialog and GetFileDialog

Community Beginner ,
Nov 23, 2017 Nov 23, 2017

Copy link to clipboard

Copied

I have been migrated source from CS4 to CC2018.

Os: mac 10.13.1

AIFileDialogFilters ops;

sAIUser->PutFileDialog(ai::UnicodeString(Title), &ops, ai::UnicodeString(csvFileName), outCSVFile);

sAIUser->GetFileDialog(ai::UnicodeString(Title), &ops, outCSVFile);

I have problem in above code snippet. There is no dialog will opened.

And I tried to set filter of *.csv files.

But it run correctly in Windows machine.

How can I set filter to this function?

Or any other possible cases available to replace this function?

Regards,

Sandy

TOPICS
SDK

Views

1.1K

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 ,
Nov 29, 2017 Nov 29, 2017

Copy link to clipboard

Copied

This code works for me on CC 2018 on mac:

        AIFileDialogFilters filter;

        filter.AddFilter(ai::UnicodeString("*.ai"));

        filter.AddFilter(ai::UnicodeString("*.*"));

        ai::UnicodeString path("/Users/Shared");

        ai::FilePath fp(path);

        sAIUser->PutFileDialog(ai::UnicodeString("Save File"),&filter,ai::UnicodeString("MyFile.ai"),fp);

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
Community Beginner ,
Nov 29, 2017 Nov 29, 2017

Copy link to clipboard

Copied

Thank you for your reply,

Your code works but, the dialog opens and disappear automatically in fractions of seconds and Illustrator has no responds for any other input. I will quit illustrator by Force Quit... option. Is any other process to do after this snippet?

There is same problem for following snippet,

sAIUser->GetFileDialog(ai::UnicodeString("Save File"),&filter, fp);

regards,

Sandy

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
Advocate ,
Nov 29, 2017 Nov 29, 2017

Copy link to clipboard

Copied

It works fine for me. When do you call this code? What else is your plugin doing?

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
Community Beginner ,
Nov 29, 2017 Nov 29, 2017

Copy link to clipboard

Copied

fPPLib.AddEventListener(EVENT_TYPE_OK_CLICKED, OkClickedFunc, this);

static void OkClickedFunc(const csxs::event::Event* const eventParam, void* const context)

{

    AIFileDialogFilters filter;

    filter.AddFilter(ai::UnicodeString("*.ai"));

    filter.AddFilter(ai::UnicodeString("*.*"));

    ai::UnicodeString path("/Users/Shared");

    ai::FilePath fp(path);

    AIErr erstatus=sAIUser->PutFileDialog(ai::UnicodeString("Save File"),&filter,ai::UnicodeString("MyFile.ai"),fp);

}

It doesn't work in Event Listener function.

Other than its work fine.

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
Advocate ,
Nov 29, 2017 Nov 29, 2017

Copy link to clipboard

Copied

You need to set the app context if your code is not called from a plugin message

static void OkClickedFunc(const csxs::event::Event* const eventParam, void* const context)

{

    AppContext appContext(pluginRef);

    AIFileDialogFilters filter;

    filter.AddFilter(ai::UnicodeString("*.ai"));

    filter.AddFilter(ai::UnicodeString("*.*"));

    ai::UnicodeString path("/Users/Shared");

    ai::FilePath fp(path);

    AIErr erstatus=sAIUser->PutFileDialog(ai::UnicodeString("Save File"),&filter,ai::UnicodeString("MyFile.ai"),fp);

}

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
Community Beginner ,
Nov 30, 2017 Nov 30, 2017

Copy link to clipboard

Copied

Thank you for your replay,

But your code yet not work.

I will attached Project with your code.

FreeGrid.zip - Google Drive

Copy this code in sample codes in Adobe Illustrator CC 2018 SDK.

Please check the code.

Run the plugin by following steps,

1. Choose Windows->SDK->FreeGrid

2. Press the “Transform” button in bottom of dialog.

Then you got an issue.

But, I will add this code as follows,

freeGridController->UnloadExtension();

sAIUser->PutFileDialog(ai::UnicodeString("Save File"),&filter,ai::UnicodeString("MyFile.ai"),fp);

Then only PutFileDialog dialog will displayed, but freeGridController dialog didn’t close because, I will UnloadExtension().

Is this correct process?

Is any other possible ways to display PutFileDialog dialog and close freeGridController dialog?

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
Advocate ,
Nov 30, 2017 Nov 30, 2017

Copy link to clipboard

Copied

LATEST

I can give you advice and answer questions. I don't have time to debug your code for you.

I see you are calling PutFileDialog from a csxs event callback. I have had problems before with showing popups while a panel is open. You could try unloading the extension in the callback and then setting a zero timer to call your code that calls PutFileDialog.

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