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

How can I remove popups when I open a file with a script?

Community Beginner ,
Jul 24, 2023 Jul 24, 2023

Copy link to clipboard

Copied

 When I open a file with the help of a script, a window like this or any other will appear. where I need to choose a variant. I know the right variant, but I still need to click the button. how can I make the variant to be chosen automatically?

2023-07-21_15-55-42.png

TOPICS
Actions and scripting

Views

540

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

Community Expert , Jul 24, 2023 Jul 24, 2023

Some dialogs can be suppressed, not sure about all of them. 

displayDialogs = DialogModes.NO;
app.open(File(/*insert file path here*/));
displayDialogs = DialogModes.ERROR;

Votes

Translate

Translate
Adobe
Community Beginner ,
Jul 24, 2023 Jul 24, 2023

Copy link to clipboard

Copied

Or windows may appear in the process....

2023-07-24_08-12-42.png

2023-07-21_15-54-25.png

  

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 Expert ,
Jul 24, 2023 Jul 24, 2023

Copy link to clipboard

Copied

Some dialogs can be suppressed, not sure about all of them. 

displayDialogs = DialogModes.NO;
app.open(File(/*insert file path here*/));
displayDialogs = DialogModes.ERROR;

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 ,
Jul 24, 2023 Jul 24, 2023

Copy link to clipboard

Copied

I think it's a little different here. I need not just not to display the window, but to tell it what to do in this or that case.

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 Expert ,
Jul 24, 2023 Jul 24, 2023

Copy link to clipboard

Copied

quote

I think it's a little different here. I need not just not to display the window, but to tell it what to do in this or that case.


By @Aleksei5C75


So do you get usable AM code recorded by the ScriptingListener plug-in?

 

If so you can set a conditional.

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 ,
Jul 24, 2023 Jul 24, 2023

Copy link to clipboard

Copied

No, I just open the file and it opens with a window where you have to select an option, or during the script process other windows appear, where you also have to select the result.

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 Expert ,
Jul 24, 2023 Jul 24, 2023

Copy link to clipboard

Copied

quote

No, I just open the file and it opens with a window where you have to select an option

And what AM-code is generated for that? 

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 ,
Jul 25, 2023 Jul 25, 2023

Copy link to clipboard

Copied

I just open with the command app.open(path to file), and then a window appears for selecting the necessary option. at the same time no code appears in ScriptListereJS.log yt at all.

Aleksei5C75_1-1690278795452.png

 

 

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 Expert ,
Jul 25, 2023 Jul 25, 2023

Copy link to clipboard

Copied

Did you click the button you wanted? 

 

Edit: I tested with recording opening an image with missing Links without relinking and the code created ineed opens it without 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
Community Expert ,
Jul 25, 2023 Jul 25, 2023

Copy link to clipboard

Copied

Can you attach the offending PSD files? They could be 1px in size, it seems that this is more about the file/layer structure than anything.

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 ,
Jul 25, 2023 Jul 25, 2023

Copy link to clipboard

Copied

when opening this file, the following request to choose an opening option is displayed

Aleksei5C75_0-1690286283304.png

 

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 Expert ,
Jul 25, 2023 Jul 25, 2023

Copy link to clipboard

Copied

And why don’t you mention which of the options you use? 

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 Expert ,
Jul 25, 2023 Jul 25, 2023

Copy link to clipboard

Copied

// =======================================================
var idopen = stringIDToTypeID( "open" );
    var desc6 = new ActionDescriptor();
    var iddontRecord = stringIDToTypeID( "dontRecord" );
    desc6.putBoolean( iddontRecord, false );
    var idforceNotify = stringIDToTypeID( "forceNotify" );
    desc6.putBoolean( idforceNotify, true );
    var idnull = stringIDToTypeID( "null" );
    desc6.putPath( idnull, new File( /*insert path here*/ ) );
    var iddocumentID = stringIDToTypeID( "documentID" );
    desc6.putInteger( iddocumentID, 63 );
    var idtemplate = stringIDToTypeID( "template" );
    desc6.putBoolean( idtemplate, false );
executeAction( idopen, desc6, DialogModes.NO );

seems to work fine for opening the image with Layers and without the 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
Community Beginner ,
Jul 25, 2023 Jul 25, 2023

Copy link to clipboard

Copied

LATEST

I just add

app.displayDialogs = DialogModes.NO;
and it 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