scripting: detect copy or cut

Features wanted...
Post Reply
bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

scripting: detect copy or cut

Post 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.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: scripting: detect copy or cut

Post 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! :cup: :biggrin:
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

admin
Site Admin
Posts: 60526
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: scripting: detect copy or cut

Post by admin »

Next version you can use this new undocumented argument to SC get():

Code: Select all

text get("clipboarddropeffect");
Returned is a bit field:
fdDropEffectNone = 0
fdDropEffectCopy = 1
fdDropEffectMove = 2
fdDropEffectLink = 4

Usually "Copy" items return "5" (1+4), "Cut" items return "2".

admin
Site Admin
Posts: 60526
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: scripting: detect copy or cut

Post 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! :cup: :biggrin:
Ha, that's not so easy. Here is another undocumented argument for you:

Code: Select all

text <get clipboardformats <crlf>>;

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: scripting: detect copy or cut

Post by bdeshi »

admin wrote:Next version you can use this new undocumented argument to SC get():

Code: Select all

text get("clipboarddropeffect");
wonderful, thanks!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: scripting: detect copy or cut

Post 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! :cup: :biggrin:
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!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Post Reply