Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

How to paste clipboard text into a text layer?

$
0
0
My client has asked me to help them script some PS actions. Their need is to take a text file, extract line by line, create a PS document that contains the text of a given line, run some actions/filters on it, and save it.

I have an AppleScript that takes the master text file and loops over every line in the file. For each iteration, I copy the the line of text to the clipboard. I have recorded PS Actions that create a new document, create a text layer, paste the clipboard text into the text layer, and then continues on applying the filters et al.

Creating the document and creating the text layer are no problem. Pasting the text from the clipboard has been a huge problem. PS simply won't paste. It complains "The command "Paste" is not currently available." I think it's wrong, since before I ran that action, I looked at the Edit menu, and Paste certainly was enabled and selectable. The text in the text layer was highlighted/selected, and I'm able to paste manually. So why can't PS paste automatically?

I have a "Make" action, which makes the document. I have a "Make Text Layer" action that creates the text layer in that document; this leaves the "boilerplate" placeholder text selected, such that a subsequent Paste operation would overwrite it with the contents of the clipboard. But this is what PS refuses to do. I've tried it from a PS action, and I've tried it using the 'paste' command in an Applescript; both result in the aforementioned error.

I think I need it to be a text layer, because subsequent steps change the font, size, apply various filters to it. We tried converting the text lines to PDF files, but weren't able to modify the text then.

Any ideas?

Thanks.
randy

Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>