Skip to main content
Known Participant
February 18, 2023
Question

extendscript reference to the copied layer / property

  • February 18, 2023
  • 2 replies
  • 2810 views

How to reference/access the copied layer in extendscript?

This topic has been closed for replies.

2 replies

HrachMAuthor
Known Participant
February 19, 2023

Here is what I wanted. But haaven't tried yet.

 

Dan Ebberts
Community Expert
Community Expert
February 19, 2023

I don't think a layer will actually end up in the clipboard. You could get keyframe data as text that way, but that won't even identify the layer it came from. I don't think it will do what you want, but I'd love to be surprised.

HrachMAuthor
Known Participant
February 19, 2023

the copied text content is sufficient for my needs. However if not, another solution is to copy the reference (ctrl+alt+c) of a layer property, if you paste it into some text editing area, you will see the reference to the layer in the text data. like comp("name").layer("name").transform.position for example.

Mylenium
Legend
February 18, 2023

What copied layer? How is it even copied and what do you want to do with it? You need to explain better.

 

Mylenium

HrachMAuthor
Known Participant
February 18, 2023

I want to copy a layer and then run my script, so that in my script I access the copied layer, like paste command pastes the copied layer.

Dan Ebberts
Community Expert
Community Expert
February 18, 2023

Yes you got it. I want my script to write expression to the selected layers, in which it will have reference to the copied layer. Yes the pasting temporarily and deleting after I'm done is a way, I thought it, just wanted to know if there were shorter way, thank you


I don't know if this helps, but selectedLayers are in the array in the order that you select them, so maybe your work flow could be (instead of copying the reference layer) to first select the reference layer, and then select the layers that recieve the expression. Then selectedLayers[0] would always be the reference layer.