Copy link to clipboard
Copied
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 );
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
...
- 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 = stringIDTo
Copy link to clipboard
Copied
Changing the following line of code appears to fixed it
From > executeAction( idmodalStateChanged, desc46, DialogModes.NO );
To > executeAction( idmodalStateChanged, desc46, DialogModes.ALL );
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
pixxxel schubser wrote:
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?
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
Copy link to clipboard
Copied
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
- 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 );
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
- var desc3=newActionDescriptor();
- var ref1=newActionReference();
- ref1.putEnumerated(charIDToTypeID('Dcmn'),charIDToTypeID('Ordn'),charIDToTypeID('Trgt'));
- desc3.putReference(charIDToTypeID('null'),ref1);
- desc3.putString(charIDToTypeID('T'),"AdobeRGB(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);
this code does it.
Have fun
Copy link to clipboard
Copied
Ah, yes you are perfectly correct, my mistake, sorry.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now