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

Please help, error when placedLayerEditContents.

Explorer ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

Hello,

when i use code bellow

'app.activeDocument.activeLayer = layer
executeAction( sTT('placedLayerEditContents'), undefined, DialogModes.NO );'

 

error occured: The command edit content is not currently available.

what is wrong??

 

Thanks so much

TOPICS
Actions and scripting

Views

1.4K

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
Adobe
Community Expert ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

These work for me:

 

var idplacedLayerEditContents = stringIDToTypeID( "placedLayerEditContents" );
    var desc3536 = new ActionDescriptor();
executeAction( idplacedLayerEditContents, desc3536, DialogModes.NO );

 

or

 

app.runMenuItem(stringIDToTypeID('placedLayerEditContents'));

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
Explorer ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

thanks,but not for me ,still error. this is my code:

function _checkLayers(layers, expFile)
{
for(var i = 0 ; i < layers.length ; i++)
{
var layer = layers[i];

if ( layer.visible == false ) {
continue
}
if(layer.typename == 'ArtLayer')
{
if ( layer.bounds[0] < layer.bounds[2] && layer.bounds[1] < layer.bounds[3] )
{
app.activeDocument.activeLayer = layer
_trySaveImage( expFile )
}
}
else
{
_checkLayers(layer.layers, expFile);
}
}
}

function _trySaveImage( expFile ) {
var layer = app.activeDocument.activeLayer
var fn = _getLayerName(layer)
var filename = _getUniquePngName(fn)//create unique png name
_writeData(layer, filename, expFile);//export layer data
if ( layer.kind != LayerKind.TEXT && !_isCommonPng(fn))
{
app.activeDocument.activeLayer = layer
var desc3536 = new ActionDescriptor();
executeAction( sTT('placedLayerEditContents'), desc3536, DialogModes.NO );
_saveImage(filename);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
allnames.push( filename )
}
}

 

_checkLayers(app.activeDocument.layers,expFile).

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 ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

Could you please post screenshots with the pertinent Panels (Toolbar, Layers, Options Bar, …) visible? 

 

The Script seems to check against Type Layers but not whether the Layer is a Smart Object. 

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
Guide ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

@c.pfaffenbichler, i think in this case there will be a different error message. But i can't check it now

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
Explorer ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

My photoshop only supports chinese ...

hui5C21_0-1630659209713.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 ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

The active Layer seems to be a Shape Layer, not a Smart Object, so placedLayerEditContents would not be able to be performed on it. 

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
Guide ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

Del

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
People's Champ ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

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
LEGEND ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

Oh loll, now it seems I didn't notice something you said few minutes earlier 😉

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
LEGEND ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

What about c.pfaffenbichler, didn't he noticed it as very first?

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
Guide ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

Yes. I missed his message. Deleted my comment so as not to be misleading

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
LEGEND ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

Now without original content in your post, reading our conversation misleads even more 😛

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
Guide ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

in manual mode without using a script are smart objects edited normally?

 

I had a similar problem when using a script and accidentally changed the name of the layer with ASCII control character inside it.

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
LEGEND ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

Could you give an example of such ASCII control characer in layer name making the 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
Guide ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

OK. I'll try to find files with this layers.

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
Guide ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

Found. The problem was not in renaming the smart object, but in the fact that after renaming the pixel layer with the script, it was converted into a smart object:

 

activeDocument.activeLayer.name = activeDocument.activeLayer.name  +"\r" 
executeAction( stringIDToTypeID('newPlacedLayer'), undefined, DialogModes.NO );
executeAction( stringIDToTypeID('placedLayerEditContents'), undefined, DialogModes.NO ); //error

 

(there will be an error with other control characters).  

 

if you rename an already created smart object, there will be no 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
LEGEND ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

I tried to reproduce it manually by pasting control character but it worked. A scripting bug?

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
Guide ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

I tried renaming the layer by adding a carriage return code (manually typing alt + 013, and also pasting this symbol through the buffer) and after that read the layer name through a script. I did not see this char code, and did not see changing the number of characters in the name. Most likely, there is a control of characters during manual input and such an error is simply impossible to reproduce without the use of scripts.

 

Photoshop separately stores the name of the smart object assigned to it during creation and current name of layer (this can explain the absence of an error when renaming a ready-made smart object). The error occurs if there are characters in the original name are incompatible with the file system.

 

2021-09-03_23-31-37.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
People's Champ ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

quote

I tried renaming the layer by adding a carriage return code (manually typing alt + 013, and also pasting this symbol through the buffer) and after that read the layer name through a script. I did not see this char code, and did not see changing the number of characters in the name. Most likely, there is a control of characters during manual input and such an error is simply impossible to reproduce without the use of scripts.

 

By @jazz-y

 

Untitled-2.png

 

: )

 

upd. у топикстартера не смарт-объект

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
Guide ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

Я не за компьютером. А перевод каретки или символ новой строки?

 

Точно, у него там шейп 🤦

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
People's Champ ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

где? файл в упор не вижу. каретка таким макаром записывается как видимый символ, но ошибки не вызывает, но твой скрипт интересен. ломает смарт-рбект на прочь, даже для ручного редактирования. потом разберусь. сейчас некогда.

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
Guide ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

Показалось (с телефона). 

 

1 сентября? 🙂

 

Да, можно лочить смарт-объекты. Правда я это как-то обходил (запорол кучу слоев, потом разгребал как их отредактировать). Пару лет назад было, не помню что сделал в итоге.

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
People's Champ ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

quote

Да, можно лочить смарт-объекты. Правда я это как-то обходил (запорол кучу слоев, потом разгребал как их отредактировать). Пару лет назад было, не помню что сделал в итоге.


By @jazz-y

 

экспорт контент - реплейс на этот файл

не? : )

 

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
People's Champ ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

quote

 А перевод каретки или символ новой строки?


By @jazz-y

 

Ни черта оказывается не работает через дублирование : (.

При наборе AltDown 13 AltUp вставляется "нота" - 0x266A почему-то, а не 0xD. Если в буфер засунуть реально этот символ (13 или 10 или другие), то фотошоповские контролы его просто не воспринимают.

Так что руками такую ситуацию не воспроизвести. Стандартные не файловые символы отфильтровываюися из имени  слоя в момент создания имени файла при создании смарт-объекта.

НО ПРО ВОЗВРАТ КАРЕТКИ ОНИ ЗАБЫЛИ!! БАГ!! 🙂

 

 

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