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

Open Convert To Profile Window

Contributor ,
Nov 10, 2016 Nov 10, 2016

I am trying to open the Convert To profile Window, the same as going to Edit > Convert To Profile through a script but I am not having a great deal of success.

The Script-Listener outputs the following but I am not able to open the Convert To Profile window from it.

var idmodalStateChanged = stringIDToTypeID( "modalStateChanged" );

    var desc46 = new ActionDescriptor();

    var idLvl = charIDToTypeID( "Lvl " );

    desc46.putInteger( idLvl, 1 );

    var idStte = charIDToTypeID( "Stte" );

    var idStte = charIDToTypeID( "Stte" );

    var identer = stringIDToTypeID( "enter" );

    desc46.putEnumerated( idStte, idStte, identer );

    var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" );

    desc46.putBoolean( idkcanDispatchWhileModal, true );

executeAction( idmodalStateChanged, desc46, DialogModes.NO );

TOPICS
Actions and scripting
1.2K
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

correct answers 1 Correct answer

Community Expert , Nov 10, 2016 Nov 10, 2016

ian-barber schrieb:

… Thank you, by changing executeAction( idmodalStateChanged, desc46, DialogModes.ALL );in my code did fetch up the dialog window but your code looks cleaner.

No. Sorry.

Your code

  1. var idmodalStateChanged = stringIDToTypeID( "modalStateChanged" ); 
  2.     var desc46 = new ActionDescriptor(); 
  3.     var idLvl = charIDToTypeID( "Lvl " ); 
  4.     desc46.putInteger( idLvl, 1 ); 
  5.     var idStte = charIDToTypeID( "Stte" ); 
  6.     var idStte = charIDToTypeID( "Stte" ); 
  7.     var identer = stringIDTo
...
Translate
Adobe
Contributor ,
Nov 10, 2016 Nov 10, 2016

Changing the following line of code appears to fixed it

From > executeAction( idmodalStateChanged, desc46, DialogModes.NO );

To > executeAction( idmodalStateChanged, desc46, DialogModes.ALL );

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
Community Expert ,
Nov 10, 2016 Nov 10, 2016

Sorry. But your code is totally wrong!

You need something like this:

var desc3 = new ActionDescriptor();

var ref1 = new ActionReference();

ref1.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );

desc3.putReference( charIDToTypeID('null'), ref1 );

desc3.putString( charIDToTypeID('T   '), "Adobe RGB (1998)" );

desc3.putEnumerated( charIDToTypeID('Inte'), charIDToTypeID('Inte'), charIDToTypeID('Clrm') );

desc3.putBoolean( charIDToTypeID('MpBl'), true );

desc3.putBoolean( charIDToTypeID('Dthr'), true );

desc3.putBoolean( stringIDToTypeID('rasterizePlaced'), false );

desc3.putInteger( charIDToTypeID('sdwM'), 2 );

executeAction( stringIDToTypeID('convertToProfile'), desc3, DialogModes.ALL );

Have fun

By the way – what happens with your other thread?

Display Document Profile

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
Contributor ,
Nov 10, 2016 Nov 10, 2016

pixxxel schubser wrote:

Sorry. But your code is totally wrong!

You need something like this:

  1. vardesc3=newActionDescriptor();
  2. varref1=newActionReference();
  3. ref1.putEnumerated(charIDToTypeID('Dcmn'),charIDToTypeID('Ordn'),charIDToTypeID('Trgt'));
  4. desc3.putReference(charIDToTypeID('null'),ref1);
  5. desc3.putString(charIDToTypeID('T'),"AdobeRGB(1998)");
  6. desc3.putEnumerated(charIDToTypeID('Inte'),charIDToTypeID('Inte'),charIDToTypeID('Clrm'));
  7. desc3.putBoolean(charIDToTypeID('MpBl'),true);
  8. desc3.putBoolean(charIDToTypeID('Dthr'),true);
  9. desc3.putBoolean(stringIDToTypeID('rasterizePlaced'),false);
  10. desc3.putInteger(charIDToTypeID('sdwM'),2);
  11. executeAction(stringIDToTypeID('convertToProfile'),desc3,DialogModes.ALL);

Have fun

By the way – what happens with your other thread?

Display Document Profile

Thank you, by changing executeAction( idmodalStateChanged, desc46, DialogModes.ALL );in my code did fetch up the dialog window but your code looks cleaner.

As for the Display Document profile on a label, I am still going through the website examples which someone pointed me to

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
Community Expert ,
Nov 10, 2016 Nov 10, 2016

ian-barber schrieb:

… Thank you, by changing executeAction( idmodalStateChanged, desc46, DialogModes.ALL );in my code did fetch up the dialog window but your code looks cleaner.

No. Sorry.

Your code

  1. var idmodalStateChanged = stringIDToTypeID( "modalStateChanged" ); 
  2.     var desc46 = new ActionDescriptor(); 
  3.     var idLvl = charIDToTypeID( "Lvl " ); 
  4.     desc46.putInteger( idLvl, 1 ); 
  5.     var idStte = charIDToTypeID( "Stte" ); 
  6.     var idStte = charIDToTypeID( "Stte" ); 
  7.     var identer = stringIDToTypeID( "enter" ); 
  8.     desc46.putEnumerated( idStte, idStte, identer ); 
  9.     var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" ); 
  10.     desc46.putBoolean( idkcanDispatchWhileModal, true ); 
  11. executeAction( idmodalStateChanged, desc46, DialogModes.NO ); 

does never call the "convert to profile dialog".

It seems to be you copied the wrong part from the Script Listener code.

In contrast to

  1. var desc3=newActionDescriptor();
  2. var ref1=newActionReference();
  3. ref1.putEnumerated(charIDToTypeID('Dcmn'),charIDToTypeID('Ordn'),charIDToTypeID('Trgt'));
  4. desc3.putReference(charIDToTypeID('null'),ref1);
  5. desc3.putString(charIDToTypeID('T'),"AdobeRGB(1998)");
  6. desc3.putEnumerated(charIDToTypeID('Inte'),charIDToTypeID('Inte'),charIDToTypeID('Clrm'));
  7. desc3.putBoolean(charIDToTypeID('MpBl'),true);
  8. desc3.putBoolean(charIDToTypeID('Dthr'),true);
  9. desc3.putBoolean(stringIDToTypeID('rasterizePlaced'),false);
  10. desc3.putInteger(charIDToTypeID('sdwM'),2);
  11. executeAction(stringIDToTypeID('convertToProfile'),desc3,DialogModes.ALL);

this code does it.

Have fun

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
Contributor ,
Nov 11, 2016 Nov 11, 2016
LATEST

Ah, yes you are perfectly correct, my mistake, sorry.

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