Create shortcut for "Copy Shortcut Target Item" command - Is it possible?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
mu-sick
Posts: 37
Joined: 08 Dec 2016 07:31

Create shortcut for "Copy Shortcut Target Item" command - Is it possible?

Post by mu-sick »

Hello everyone, great forum! Just a question...
Is it possible to assign a shortcut key for "Copy Shortcut Target Item" command? It seems there is no command in the command list. Thank you

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Create shortcut for "Copy Shortcut Target Item" command - Is it possible?

Post by highend »

As long as that command isn't given a command id (through Don) you could only use a user defined command,
assign a keyboard shortcut to it and use a script (and the whole thing is only valid for the pro version...):

Code: Select all

copy property("#LinkTarget", <curitem>);
One of my scripts helped you out? Please donate via Paypal

mu-sick
Posts: 37
Joined: 08 Dec 2016 07:31

Re: Create shortcut for "Copy Shortcut Target Item" command - Is it possible?

Post by mu-sick »

highend wrote:As long as that command isn't given a command id (through Don) you could only use a user defined command,
assign a keyboard shortcut to it and use a script (and the whole thing is only valid for the pro version...):

Code: Select all

copy property("#LinkTarget", <curitem>);
Thank you for the prompt reply! How to change <curitem> to copy linktarget from all selected items? I have tried <allitems> and < selitems> but it doesn't work...

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Create shortcut for "Copy Shortcut Target Item" command - Is it possible?

Post by highend »

property() is a single item operation. So you need to do this in a loop

Code: Select all

    $items = "";
    foreach($item, <get SelectedItemsPathNames |>) {
        if (gpc($item, "ext") != "lnk") { continue; }
        $items = $items . property("#LinkTarget", $item) . "|";
    }
    copy $items;
One of my scripts helped you out? Please donate via Paypal

mu-sick
Posts: 37
Joined: 08 Dec 2016 07:31

Re: Create shortcut for "Copy Shortcut Target Item" command - Is it possible?

Post by mu-sick »

highend wrote:property() is a single item operation. So you need to do this in a loop

Code: Select all

    $items = "";
    foreach($item, <get SelectedItemsPathNames |>) {
        if (gpc($item, "ext") != "lnk") { continue; }
        $items = $items . property("#LinkTarget", $item) . "|";
    }
    copy $items;
This is great! Thank you very much!

Post Reply