Page 1 of 1

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

Posted: 08 Dec 2016 07:35
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

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

Posted: 08 Dec 2016 07:51
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>);

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

Posted: 08 Dec 2016 08:44
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...

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

Posted: 08 Dec 2016 09:22
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;

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

Posted: 08 Dec 2016 10:40
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!