Highlighted

Error when trying to rasterise smart object using JavaScript

New Here ,
Aug 30, 2020

Copy link to clipboard

Copied

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, Problem or error

Views

36

Likes

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

Error when trying to rasterise smart object using JavaScript

New Here ,
Aug 30, 2020

Copy link to clipboard

Copied

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, Problem or error

Views

37

Likes

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
Advocate ,
Aug 30, 2020

Copy link to clipboard

Copied

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 );
}

Likes

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
Reply
Loading...
New Here ,
Aug 30, 2020

Copy link to clipboard

Copied

Hi, the following appears to work

function rasteriseObject(){
	var idrasterizeAll = stringIDToTypeID( "rasterizeAll" );
	executeAction( idrasterizeAll, undefined, DialogModes.NO );
}

Likes

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
Reply
Loading...