Terminal Server - Copy to clipboard in local

Features wanted...
petersboulton
Posts: 157
Joined: 01 Sep 2008 09:54

Terminal Server - Copy to clipboard in local

Post by petersboulton »

Greetings!

I do a lot of work in Terminal Server / Remote Desktop. Would it be possible to add an option to the 'File' -> 'To Clipboard' menu to copy the pathname/filename from the local computer (i.e. not the TS) as it will appear to the Remote Desktop session?

In other words, say my local computer running XY is looking at "C:\Windows" I would like to have the option of copying that path as "\\tsclient\c\Windows" to the clipboard.

Then, when I'm in my TS session I can paste that path directly into XY or Windows Explorer and go to the location in one step, rather than having to navigate there (which is slow, not XY's fault) or (perish the thought) type it all in manually.

Would this be possible in a (near :D ) future release?

Many thanks!

Pete

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

Re: Terminal Server - Copy to clipboard in local

Post by admin »

I don't want to add this to the GUI which is already pretty loaded. But I could add a variable <computer> that would be resolved to the computer name. The rest could be done via a little script using the string manilulation functions, IOW you would write a UDC/Script for it.

petersboulton
Posts: 157
Joined: 01 Sep 2008 09:54

Re: Terminal Server - Copy to clipboard in local

Post by petersboulton »

I don't want to add this to the GUI which is already pretty loaded
One more little (incredibly useful) option won't hurt then, surely? :)

Have you ever done a survey of what proportion of your user base uses scripts and what proportion don't? Quite frankly, I do enough coding in my life without having to muck about with learning another lot and I use XYplorer to save time, not use up time.

I'd be surprised if I'm alone in that sentiment. I would guess that scripters are much more active in your forums than non-scripters, but that shouldn't mean (and I'm not saying it does mean) that they get less share of the developer's mind and resource.

Pete

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Terminal Server - Copy to clipboard in local

Post by jacky »

Well, you say it would be an incredibly useful addition, and I don't doubt it might be for you, but that doesn't mean it would be for a lot of people, or should be worth adding to XY if it's already doable otherwise. There's scripting and scripting. Scripting does allow for a lot of things, some complicated ones, and some quite simple ones. And it does allow users to get their own little things without "bloating" XY.

This, for instance, I feel would fall there. Just like some can have a little script to copy to clipboard the path/name of the current item (e.g. c:\project\www\folder\index.htm) into an URL (e.g. http://www.somewhere.com/folder/index.htm)

I'm not sure exactly how what you need would work, but if that's just a simple conversion of d:\path to \\tsclient\d\Path you can easily achieve that :

Code: Select all

  substr $drive, <curpath>, 0, 1:
  substr $path, <curpath>, 3;
  copytext "\\tsclient\$drive\$path";
Or, using a regexp:

Code: Select all

  regexreplace $name, <curpath>, "^([a-z]):\\(.+)$", "\\tsclient\$1\$2";
  copytext $name;
Maybe no need to add this to XY if you can already add it yourself (and assign a KS to it) ?
Proud XYplorer Fanatic

petersboulton
Posts: 157
Joined: 01 Sep 2008 09:54

Re: Terminal Server - Copy to clipboard in local

Post by petersboulton »

Hi Jacky,

When I said
One more little (incredibly useful) option
it was a little tongue in cheek. (Although a search on 'tsclient' in the forum shows there are a number of users who are using TS for whom the suggestion might be useful. You say "that doesn't mean it would be for a lot of people" but, like me, actually you don't know that.)

However, I do appreciate that as well as rebuking me you have taken the trouble to script my request for me, so thank you.

I do still think that non-scripters (apart from me) may represent a silent majority who would like to see more non-scripting enhancements for Xy.

Finally, when a suggestion is rejected due to it causing "bloat", is it the memory footprint or the interface complexity that is being referred to? Because XY is currently reported as taking under 7Mb of my memory, which is remarkably low for what it does. Also, I know that adding my request would add absolutely minimal memory overhead to Xy. 'Bloat' is an easy cry to reject suggestions which you personally don't perceive as useful (but others may).

Finally, finally! I bought a lifetime licence in the hope and expectation that I would benefit from good, meaningful enhancements. I understand that coding takes time and everything cannot be delivered at once, and perhaps when Xy goes dual/multi pane, as I understand it will eventually do, I will feel my lifetime licence is getting me some benefits. I cannot change the developer's priority, but I can log the fact that there are paid up XY users who would like improvements outside the scripting.

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

Re: Terminal Server - Copy to clipboard in local

Post by admin »

jacky wrote:Well, ...

I'm not sure exactly how what you need would work, but if that's just a simple conversion of d:\path to \\tsclient\d\Path you can easily achieve that :

Code: Select all

  substr $drive, <curpath>, 0, 1:
  substr $path, <curpath>, 3;
  copytext "\\tsclient\$drive\$path";
Or, using a regexp:

Code: Select all

  regexreplace $name, <curpath>, "^([a-z]):\\(.+)$", "\\tsclient\$1\$2";
  copytext $name;
Maybe no need to add this to XY if you can already add it yourself (and assign a KS to it) ?
Oh, so it's always "\\tsclient"? I was making it more complicated than it was! :roll: So forget about <computer>, and do how jacky told you.

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Terminal Server - Copy to clipboard in local

Post by j_c_hallgren »

Not being a scripter myself, as what I do tends to be more simple, I can see both sides of this...so maybe some of these "add-on" scripts need to be accumulated and incorporated into the release as samples? Since they can be executed in ways that are just about as easy as if they were built-in, and it also would give users a better idea of what can be done without having to spend time here in the forums.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

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

Re: Terminal Server - Copy to clipboard in local

Post by admin »

j_c_hallgren wrote:Not being a scripter myself, as what I do tends to be more simple, I can see both sides of this...so maybe some of these "add-on" scripts need to be accumulated and incorporated into the release as samples? Since they can be executed in ways that are just about as easy as if they were built-in, and it also would give users a better idea of what can be done without having to spend time here in the forums.
Once we have snippets you can just drop them onto the app...

petersboulton
Posts: 157
Joined: 01 Sep 2008 09:54

Re: Terminal Server - Copy to clipboard in local

Post by petersboulton »

For this path:

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\dotnetfx\WindowsInstaller-KB893803-v2-x86.exe

.. the script ...

substr $drive, <curpath>, 0, 1:
substr $path, <curpath>, 3;
copytext "\\tsclient\$drive\$path";

.. puts this text into the clipboard:

\\tsclient\$drive\$path

... whereas the script ...

regexreplace $name, <curpath>, "^([a-z]):\\(.+)$", "\\tsclient\$1\$2";
copytext $name;

.. puts this....

\\tsclient\C\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\dotnetfx

Neither are right, though the second just misses the file extension ('.exe').

So, it ain't that simple! :D

Now I know if I'd spent the time learning scripting I could solve this myself faster than all my posts today, and maybe the tsclient thing is the wrong one to argue on, but I still think that scripting should be for things that are totally local to the user's environment. If Xy aspires to be the best file manager replacement, things that are general (eg network and ts navigation) should be core.

I don't want this to sound angry or to start any flame wars. I know all the replies were meant to be helpful. I think I will go quiet now. (So something good has come out of this post. 8) )

Pete

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Terminal Server - Copy to clipboard in local

Post by serendipity »

petersboulton wrote:For this path:

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\dotnetfx\WindowsInstaller-KB893803-v2-x86.exe

.. the script ...

substr $drive, <curpath>, 0, 1:
substr $path, <curpath>, 3;
copytext "\\tsclient\$drive\$path";

.. puts this text into the clipboard:

\\tsclient\$drive\$path

... whereas the script ...

regexreplace $name, <curpath>, "^([a-z]):\\(.+)$", "\\tsclient\$1\$2";
copytext $name;

.. puts this....

\\tsclient\C\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\dotnetfx

Neither are right, though the second just misses the file extension ('.exe').

So, it ain't that simple! :D
The first script had a small error, jacky mistyped ":" on first line instead of ";". Since you said path, Jacky gave a script for current path (not current item path). But if you need the path for the selected item then this should do.

Code: Select all

  substr $drive, <curpath>, 0, 1;
  substr $item, <curitem>, 3;
  copytext "\\tsclient\$drive\$item";
I hope that helps. :D

petersboulton
Posts: 157
Joined: 01 Sep 2008 09:54

Re: Terminal Server - Copy to clipboard in local

Post by petersboulton »

substr $drive, <curpath>, 0, 1;
substr $item, <curitem>, 3;
copytext "\\tsclient\$drive\$item";
Yup, thanks! Thanks for taking the trouble to help me.

Doesn't work correctly on selected folder in tree though. :? Guess I'll need another script for that. Which is why a standard clipboard menu option would actually be nice!

Pete

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Terminal Server - Copy to clipboard in local

Post by serendipity »

petersboulton wrote:
substr $drive, <curpath>, 0, 1;
substr $item, <curitem>, 3;
copytext "\\tsclient\$drive\$item";
Yup, thanks! Thanks for taking the trouble to help me.

Doesn't work correctly on selected folder in tree though. :? Guess I'll need another script for that. Which is why a standard clipboard menu option would actually be nice!
Pete
Oh! I thought you were talking about some exe path before. I should have given this in the first place. This will copy file name if selected else will copy the path:

Code: Select all

  substr $drive, <curpath>, 0, 1;
  substr $path, <curpath>, 3;
  set $name, <curname>;
  copytext "\\tsclient\$drive\$path\$name";

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Terminal Server - Copy to clipboard in local

Post by jacky »

oops, yeah little typo there, sorry. And yes, as serendipity explained I thought you wanted only the current path. About the selected folder on Tree, you have two options:

- Use focus item (<focitem>) instead of current item, that way it will be either List or Tree depending on where the focus is at. Of course, it also refers to focused item on list, not selected item. (So to have the path only, focus must be on Tree, or List empty.)

Code: Select all

  substr $drive, <focitem>, 0, 1;
  substr $item, <focitem>, 3;
  copytext "\\tsclient\$drive\$item";
- Use the current item, or the current path when there are none, the current path being the selected folder on Tree usually. (Note that in this case, you'll get the path only when there are no current (focused&selected) item on List, regardless of where the focus is)

Code: Select all

  $path = (<curitem> == "") ? <curpath> : <curitem>;
  substr $drive, $path, 0, 1;
  substr $item, $path, 3;
  copytext "\\tsclient\$drive\$item";
Proud XYplorer Fanatic

petersboulton
Posts: 157
Joined: 01 Sep 2008 09:54

Re: Terminal Server - Copy to clipboard in local

Post by petersboulton »

Oh! I thought you were talking about some exe path before.
Brilliant, thanks - works like a dream!

Pete

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Terminal Server - Copy to clipboard in local

Post by PeterH »

j_c_hallgren wrote:Not being a scripter myself, as what I do tends to be more simple, I can see both sides of this...so maybe some of these "add-on" scripts need to be accumulated and incorporated into the release as samples? Since they can be executed in ways that are just about as easy as if they were built-in, and it also would give users a better idea of what can be done without having to spend time here in the forums.
Reading this I have an idea: I remember Don introducing his scripting with "enable you to expand the functions of XY..."

In this thread I see a conflict of possible bloated software, and people requesting for functions not interesting for "the majority".
Wouldn't a kind of "system-scripts", supplied inside XY-dir, allow for expansion of XY with such functions, that can be "activated" by some users by assigning KS, and ignored by the rest? (And maybe later one can add to "customizable menu" or something like that... :roll: )

In this way a lot of solutions could be made for some, without affecting the user interface for the majority. And, ass seen in this thread, those scripts could be prepared by others, with Don only "supplying" them...

(OK: before doing this, maybe script syntax should become more stable.)

Post Reply