Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
Edu-im
Topic Author
Posts: 5
Joined: Wed Sep 28, 2011 10:59 am

system.callSystem and clipboard not working

Fri Apr 04, 2014 3:13 pm

Hi all

I know this issue has been previously discussed in this forum, but it had no response. So I ask again.

The problem is that the usual Windows "copy to clipboard" command doesn't work via AE.

echo string | clipboard

does work in command.exe, but if you call the same process via system.callSystem this way

var myString = "Hello world";
system.callSystem("cmd /k \"echo " + myString + " | clip\"");

it does nothing.

Does anyone know how to make it work?

Thanks
 
yogert909
Posts: 10
Joined: Mon Apr 10, 2006 4:52 pm
Location: los angeles

Re: system.callSystem and clipboard not working

Mon May 19, 2014 4:58 pm

I'd be very interested in hearing if you find something that works as I'm working on a script that I need to copy things to the clipboard. Just to be clear, it sounds like you're working on windows, correct?
 
yogert909
Posts: 10
Joined: Mon Apr 10, 2006 4:52 pm
Location: los angeles

Re: system.callSystem and clipboard not working

Mon May 19, 2014 9:18 pm

I got it working on mac osx with:
system.callSystem("echo \"hello world\" | pbcopy")

Here's a thread which covers more complex examples on windows:
http://www.aenhancers.com/viewtopic.php?t=522

I hope this helps
 
User avatar
zlovatt
Posts: 11
Joined: Mon Oct 31, 2016 5:00 pm
Location: Los Angeles
Contact:

Re: system.callSystem and clipboard not working

Wed Nov 23, 2016 1:52 pm

While this is an ancient post, it's the most recent of various "callSystem copy to clipboard" threads. So -- here's how you can do this on Windows. My guess is that the first instance of `cmd` is closing before the output can be fed to the clipboard, but nesting it like this works just fine.

Broken into stages for legibility.

Copy string from ESTK to Windows clipboard:
var myString = "Here is a string";
var cmdString = 'cmd.exe /c cmd.exe /c "echo ' + myString + ' | clip"';
system.callSystem(cmdString);

Who is online

Users browsing this forum: No registered users and 2 guests