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

Error when trying to rasterise smart object using JavaScript

Participant ,
Aug 30, 2020 Aug 30, 2020

I get "Error 8800: General Photoshop error occurred. This functionality may not be available in this version of Photoshop."

- The command "<unknown>" is not currently available.

Line: 56

-> executeAction( idinvokeCommand, desc7, DialogModes.ON );

 

The following is the script in question, and I used script listener to capture it.

 

function rasteriseObject(){
	var idinvokeCommand = stringIDToTypeID( "invokeCommand" );
    var desc7 = new ActionDescriptor();
    var idcommandID = stringIDToTypeID( "commandID" );
    desc7.putInteger( idcommandID, 3549 );
    var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" );
    desc7.putBoolean( idkcanDispatchWhileModal, true );
	executeAction( idinvokeCommand, desc7, DialogModes.NO );
}
TOPICS
Actions and scripting
304
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
Adobe
Advocate ,
Aug 30, 2020 Aug 30, 2020

Try something like...

rasterizeLayer();

function rasterizeLayer() {
	var descriptor = new ActionDescriptor();
	var reference = new ActionReference();

	reference.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ));
	descriptor.putReference( charIDToTypeID( "null" ), reference );
	executeAction( stringIDToTypeID( "rasterizeLayer" ), descriptor, DialogModes.NO );
}
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
Participant ,
Aug 30, 2020 Aug 30, 2020
LATEST

Hi, the following appears to work

function rasteriseObject(){
	var idrasterizeAll = stringIDToTypeID( "rasterizeAll" );
	executeAction( idrasterizeAll, undefined, DialogModes.NO );
}
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