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

Read the clipboard inside a jsx

Participant ,
Nov 02, 2021 Nov 02, 2021

Copy link to clipboard

Copied

I'm trying to transfer data from some programs to AE and the most simple way to do it would be using the clipboard. Or so I thought. 

I managed to get it pasted into an edittext field and read that, worked great, but it's limited to 30,000 chars, which seems like a lot, but once you deal with matrices as strings it's not.

I found a script for ID that captures the event.originalEvent after the user pastes inside the application. Is there a method similar to that for AE edittext fields?

How can I find out what attributes an event has?

function onMyTextChanged(event) { /*reat the event*/ }

I found event.target.text for example, that helps or I can close the event.target.parent window immediately, but I'd like to know what else I can read from the passed event argument. Any Pointers?

 

TOPICS
Scripting

Views

189

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 ,
Nov 06, 2021 Nov 06, 2021

Copy link to clipboard

Copied

I think the only way to read the clipboard in a script is to use

callSystem

https://ae-scripting.docsforadobe.dev/general/system.html#system-callsystem

and then call a system command that reads the clipboard.

I use this to write the content of the clipboard to a file on Mac OS

system.callSystem("pbpaste -Prefer txt >" + tempFile.fsName);
 
Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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
Participant ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

LATEST

Thanks, that helps. But I really don't want to write files or access the cmd.exe, I'm writing a plug-in and I don't want to scare people using it. I was hoping to intercept the "original event" which would have been the paste command of the user.

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