status --> "copied to clipboard: " ....

Discuss and share scripts and script files...
Post Reply
Zardoz2293
Posts: 577
Joined: 09 Nov 2011 20:20
Location: USA

status --> "copied to clipboard: " ....

Post by Zardoz2293 »

Current Path = "C:\WhatEverMyCurrentPathIsHere"

If I use keyboard shortcut for #101 in the 'status area' displayed is "checkmark copied to clipboard: C:\WhatEverMyCurrentPathIsHere".

I have 2 Questions based on my own script.

Question (1): Code at line 5 'status area' displays "text copied: C:\WhatEverMyCurrentPathIsHere\"

What function is being used to provide the #101 "checkmark copied to clipboard: C:\WhatEverMyCurrentPathIsHere"? All I'm seeking identical functionality to #101 with "\" appended to the end of the path. What causes "text copied" vs. "copied to clipboard" output difference?


Question (2): Code at line 6 'status area' displays "checkmark copied to clipboard: C:\WhatEverMyCurrentPathIsHere\" to simulate #101 behavior. HOWEVER, when the script finishes, 'status area' displays "checkmark UDC: Load Script File | Path", which I do not get with any other script I have. What is causing the "UDC: ... " output?

Code: Select all

1	$Msg = <curpath>;
2	if substr( $Msg, strlen($Msg) != "\") {
3		$Msg = $Msg . "\";
4	}
5	copytext $Msg, , "";
6	status( "copied to clipboard: " . $Msg, , "ready" );
Thank you.
Computer/Systems Background = Expert | Windows 10 Pro (64-Bit) | Dell Precision 7720

jupe
Posts: 2800
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: status --> "copied to clipboard: " ....

Post by jupe »

Not sure if you realize but if you always want a trailing \, then you can just set this and then #101 will do the same as your script intends:

Configuration | General | Controls & More | Miscellaneous | Copy paths to the clipboard with a trailing slash

1) the copytext line is causing that msg, status should overwrite it afterwards though.
2) you must be running it via UDC incorrectly somehow, check your config properly.

Regarding the script, I will mention that your substr is wrong, it isn't just checking the last char, so will always be true, also status shouldn't have parenthesis, but your if should.

Zardoz2293
Posts: 577
Joined: 09 Nov 2011 20:20
Location: USA

Re: status --> "copied to clipboard: " ....

Post by Zardoz2293 »

jupe wrote: 12 Dec 2022 20:05 Not sure if you realize but if you always want a trailing \, then you can just set this and then #101 will do the same as your script intends:

Configuration | General | Controls & More | Miscellaneous | Copy paths to the clipboard with a trailing slash

1) the copytext line is causing that msg, status should overwrite it afterwards though.
2) you must be running it via UDC incorrectly somehow, check your config properly.

Regarding the script, I will mention that your substr is wrong, it isn't just checking the last char, so will always be true, also status shouldn't have parenthesis, but your if should.
Right on the money on all accounts! Greatly appreciated!
Computer/Systems Background = Expert | Windows 10 Pro (64-Bit) | Dell Precision 7720

Post Reply