script question: copy path

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Gogolo
Posts: 14
Joined: 25 Nov 2011 01:08

script question: copy path

Post by Gogolo »

Hi

I'd like to have a script which automatically copies the full path (e.g. "c:/adb/adb.exe") of a file to the clipboard when I click on it (open it). Is this possible? If so, can somebody help me doing this? That would be very kind, thx!

Greetings
Olivier

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

Re: script question: copy path

Post by highend »

Although this is possible (via a CFA), I wouldn't recommend it. Why don't you use Ctrl+P (File | To Clipboard | Item Path/Name(s))?
One of my scripts helped you out? Please donate via Paypal

Gogolo
Posts: 14
Joined: 25 Nov 2011 01:08

Re: script question: copy path

Post by Gogolo »

Thanks for your answer! Why shouldn't this be done?

something like: "if a file is selected, copy path to clipboard" should not be done?

it would be helpful beacause of a workflow opening pdfs and paste the paths to it later in a knowledge management tool (with the surface 3 tablet, so shortcuts would be complicated and one tap opens the file directely)

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

Re: script question: copy path

Post by highend »

(open it)
CFAs are only available when a file is opened, not when it is just selected.

The only option would be: https://github.com/XYplorer-Scripts/ItemUnderMouse
but ofc you would need to edit that to suit your needs...
One of my scripts helped you out? Please donate via Paypal

Gogolo
Posts: 14
Joined: 25 Nov 2011 01:08

Re: script question: copy path

Post by Gogolo »

sorry I didnt write it correctly, I want the path to be coppied when I open the file, not just select it. precicely: When I click on a file the path is copied to clipboard AND it opens (with the default application).

I looked into PFA but cant accomplish it. When I put *>::copytext <curitem> on top it copies the path but no file is being opened anymore. :( is it possible to use sort of AND function? thx!

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

Re: script question: copy path

Post by highend »

Code: Select all

*>::copytext "<curitem>"; run """<curitem>""";
One of my scripts helped you out? Please donate via Paypal

Gogolo
Posts: 14
Joined: 25 Nov 2011 01:08

Re: script question: copy path

Post by Gogolo »

:appl: perfect, thx very much!

Post Reply