Copy file contents
Copy file contents
Is it possible to copy a file's contents to the clipboard without opening it? Preferably from the context menu or keyboard shortcut.
I am only interested in plain text saved from a text editor. No fancy Office formatting or anything...
Thanks,
I am only interested in plain text saved from a text editor. No fancy Office formatting or anything...
Thanks,
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Copy file contents
You mean without you opening it. Will be possible soon via scripting. But of course a file must be opened to get the contents.eurytos wrote:Is it possible to copy a file's contents to the clipboard without opening it? Preferably from the context menu or keyboard shortcut.
I am only interested in plain text saved from a text editor. No fancy Office formatting or anything...
Thanks,
FAQ | XY News RSS | XY Twitter
Re: Copy file contents
yeah without me opening it. I have a folder (named _scripts go figure ) that contains a bunch of scripts or syntax I use alot. For a large portion of them I open them for the sole purpose of copy/paste into whatever app I am going to run them from so it would be nice if I could throw the contents to the clipboard.admin wrote:You mean without you opening it. Will be possible soon via scripting. But of course a file must be opened to get the contents.eurytos wrote:Is it possible to copy a file's contents to the clipboard without opening it? Preferably from the context menu or keyboard shortcut.
I am only interested in plain text saved from a text editor. No fancy Office formatting or anything...
Thanks,
Or possibly even copy/paste from the preview window?
Thanks,
-
- XY Blog Master
- Posts: 5824
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
Re: Copy file contents
Have you checked out the idea of using a clipboard manager for this task?eurytos wrote:For a large portion of them I open them for the sole purpose of copy/paste into whatever app I am going to run them from so it would be nice if I could throw the contents to the clipboard.
So that you can maintain a bunch of various items within it and move to clipboard as needed?
The one that I use is called CLCL (freeware) and it's only problem is a lack of documentation so there are a number of things/features I've no idea on what they do!
However, I can right-click on the tray icon for it, see the list of all items I've saved (via previous Cntl-C), select one and left-click it, and it's then pasted at current cursor plus copied to actual "clipboard"....You can review these entries and delete as needed.
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.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
Re: Copy file contents
mmm... "soon" !admin wrote:You mean without you opening it. Will be possible soon via scripting. But of course a file must be opened to get the contents.
No paste, no, as it's a viewer only, but you can right-click and copy from the preview, yes. (Given that it's done through XY's internal (Raw) viewer, otherwise it may depend on the app actually used, eg. Office for *.doc files, etc)eurytos wrote:Or possibly even copy/paste from the preview window?
Proud XYplorer Fanatic
Re: Copy file contents
jacky wrote:mmm... "soon" !admin wrote:You mean without you opening it. Will be possible soon via scripting. But of course a file must be opened to get the contents.
No paste, no, as it's a viewer only, but you can right-click and copy from the preview, yes. (Given that it's done through XY's internal (Raw) viewer, otherwise it may depend on the app actually used, eg. Office for *.doc files, etc)eurytos wrote:Or possibly even copy/paste from the preview window?
I didn't mean paste into the preview, just the ability to copy from it and paste into another app. I didn't think about right-click --> select all because I usually cntrl-a, cntrl-shift-home or cntrl-shift-end when I select all and that did not appear to work. But, right-click --> select all, cntrl-c does and I think I will be able to get used to that fairly easily.
Thanks,
I think I need to work on some custom keyboard shortcuts.
edit: the cntrl-a not working was because the preview format was not associated with anything so it was doing raw preview. If I try the same on a file with a .txt extension it works fine.
hmm
now to find a way to tell it .sql files should be previewed same way .txt files....
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Copy file contents
If its a text file ctrl+a and ctrl+c should work in preview mode (not Raw View).eurytos wrote:jacky wrote:mmm... "soon" !admin wrote:You mean without you opening it. Will be possible soon via scripting. But of course a file must be opened to get the contents.
No paste, no, as it's a viewer only, but you can right-click and copy from the preview, yes. (Given that it's done through XY's internal (Raw) viewer, otherwise it may depend on the app actually used, eg. Office for *.doc files, etc)eurytos wrote:Or possibly even copy/paste from the preview window?
I didn't mean paste into the preview, just the ability to copy from it and paste into another app. I didn't think about right-click --> select all because I usually cntrl-a, cntrl-shift-home or cntrl-shift-end when I select all and that did not appear to work. But, right-click --> select all, cntrl-c does and I think I will be able to get used to that fairly easily.
Thanks,
I think I need to work on some custom keyboard shortcuts.
edit: the cntrl-a not working was because the preview format was not associated with anything so it was doing raw preview. If I try the same on a file with a .txt extension it works fine.
hmm
now to find a way to tell it .sql files should be previewed same way .txt files....
Re: Copy file contents
I discovered that. Now I am trying to figure out how to preview a .sql extension just like it would a .txt extension instead of going to raw format.serendipity wrote:If its a text file ctrl+a and ctrl+c should work in preview mode (not Raw View).eurytos wrote:jacky wrote:mmm... "soon" !admin wrote:You mean without you opening it. Will be possible soon via scripting. But of course a file must be opened to get the contents.
No paste, no, as it's a viewer only, but you can right-click and copy from the preview, yes. (Given that it's done through XY's internal (Raw) viewer, otherwise it may depend on the app actually used, eg. Office for *.doc files, etc)eurytos wrote:Or possibly even copy/paste from the preview window?
I didn't mean paste into the preview, just the ability to copy from it and paste into another app. I didn't think about right-click --> select all because I usually cntrl-a, cntrl-shift-home or cntrl-shift-end when I select all and that did not appear to work. But, right-click --> select all, cntrl-c does and I think I will be able to get used to that fairly easily.
Thanks,
I think I need to work on some custom keyboard shortcuts.
edit: the cntrl-a not working was because the preview format was not associated with anything so it was doing raw preview. If I try the same on a file with a .txt extension it works fine.
hmm
now to find a way to tell it .sql files should be previewed same way .txt files....
I found:
; Tweak: user custom extensions, format eg: '.rm.ra.ext.'
ImagePreviewCustomExtensions=
MediaPreviewCustomExtensions=
OfficePreviewCustomExtensions=
but I do not seem to be having much luck after trying some variations of:
.sql, sql, 'sql', '.sql', "sql"
I will figure it out sooner or later
and of course thanks for all the help!
edit: I have had sql defined in the custom file associations to open with notepad for some time and that works perfectly.
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Copy file contents
There should be dot after extension too. Like .sql.eurytos wrote: I found:
; Tweak: user custom extensions, format eg: '.rm.ra.ext.'
ImagePreviewCustomExtensions=
MediaPreviewCustomExtensions=
OfficePreviewCustomExtensions=
but I do not seem to be having much luck after trying some variations of:
.sql, sql, 'sql', '.sql', "sql"
I will figure it out sooner or later
and of course thanks for all the help!
edit: I have had sql defined in the custom file associations to open with notepad for some time and that works perfectly.
See wiki reference below for explanation:
http://88.191.26.34/XYwiki/index.php/IN ... to_Preview
Thanks!
I was just coming back to post that I found it on the wiki.
Although the behavior does not act as I expected. I don't think it is xyplorer's fault though.
If I add the extension I am prompted with an open/save/cancel dialog box when i click on a file with that extentsion. If I choose to open it Microsoft SQL Server Management Studio launches to display the file.
I was just coming back to post that I found it on the wiki.
Although the behavior does not act as I expected. I don't think it is xyplorer's fault though.
If I add the extension I am prompted with an open/save/cancel dialog box when i click on a file with that extentsion. If I choose to open it Microsoft SQL Server Management Studio launches to display the file.
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Yeah I know xyplorer can preview the files because they display correctly if I change the extension to .txt. It must be because the sql file extension is associated with SQL Management Studio outside of xyplorer even though I have it set in xyplorer to open with notepad.
I could just change all the extensions to .txt but then I would have to tell notepad++ to display the document as a sql file everytime I opened one instead of it doing it by default.
I think I may be back to right-click select all with the raw format which is still good. Especially if the ability to copy the file contents is on the way!
Thanks again to everyone who posted here for all their help.
I could just change all the extensions to .txt but then I would have to tell notepad++ to display the document as a sql file everytime I opened one instead of it doing it by default.
I think I may be back to right-click select all with the raw format which is still good. Especially if the ability to copy the file contents is on the way!
Thanks again to everyone who posted here for all their help.
If you get yourself AutoHotkey you can use the following compiled to an exe, and then use XY's open with to add the contents of any number of files to the clipboard.
Code: Select all
result := ""
Loop %0% {
arg := %A_Index%
FileRead input, %arg%
result := result . input . "`r`n"
}
StringTrimRight result, result, 2
Clipboard := result
I appreciate the tip, thanks!TheQwerty wrote:If you get yourself AutoHotkey you can use the following compiled to an exe, and then use XY's open with to add the contents of any number of files to the clipboard.
Code: Select all
result := "" Loop %0% { arg := %A_Index% FileRead input, %arg% result := result . input . "`r`n" } StringTrimRight result, result, 2 Clipboard := result
I will take a look at this