Page 1 of 1
scripting: detect copy or cut
Posted: 04 Jul 2017 18:05
by bdeshi
Any way to detect if clipboard content was cut or copied?
The pasteto cmd may be the usual solution, but I have to process the clipped items before pasting, so I have to choose between copyto and moveto.
Or, can pasteto be enhanced to supply a target item name as well? Currently it only accepts a destination path.
Re: scripting: detect copy or cut
Posted: 04 Jul 2017 18:10
by SkyFrontier
...basic differentiation between image or text, as well as a way to properly paste one or the other would be a plus, here.
\sorry, Sammay!

Re: scripting: detect copy or cut
Posted: 16 Jul 2017 14:17
by admin
Next version you can use this new undocumented argument to SC get():
Returned is a bit field:
fdDropEffectNone = 0
fdDropEffectCopy = 1
fdDropEffectMove = 2
fdDropEffectLink = 4
Usually "Copy" items return "5" (1+4), "Cut" items return "2".
Re: scripting: detect copy or cut
Posted: 16 Jul 2017 14:19
by admin
SkyFrontier wrote:...basic differentiation between image or text, as well as a way to properly paste one or the other would be a plus, here.
\sorry, Sammay!

Ha, that's not so easy. Here is another undocumented argument for you:
Code: Select all
text <get clipboardformats <crlf>>;
Re: scripting: detect copy or cut
Posted: 18 Jul 2017 03:40
by bdeshi
admin wrote:Next version you can use this new undocumented argument to SC get():
wonderful, thanks!
Re: scripting: detect copy or cut
Posted: 18 Jul 2017 19:37
by SkyFrontier
admin wrote:SkyFrontier wrote:...basic differentiation between image or text, as well as a way to properly paste one or the other would be a plus, here.
\sorry, Sammay!

Ha, that's not so easy. Here is another undocumented argument for you:
Code: Select all
text <get clipboardformats <crlf>>;
Great, I'll check it out and see what I can when I track the projects I needed this function. Thanks!