topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 12:30 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Ctrl-C direct to sequential files in designated folder  (Read 11746 times)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
Ctrl-C direct to sequential files in designated folder
« on: March 08, 2012, 05:27 PM »
Skwire's ClipTrap and ChoppingList used together is one excellent way to get a bunch of "copy actions" into a set of files, all ready for further use.

I'm wondering if these two programs can be combined into one.

Here's the challenge:

Every time Ctrl-C is hit, the output goes directly to a new TEXT file in a designated directory in setup.

The file names are sequential numbers, depending on the numbers already existing in the directory.

The file names are zero-padded, total places designated in setup.

Example:
001.txt
002.txt
.
.
.
099.txt

Output has to be exactly like Skwire's ClipTrap -- example: including original TABS where they exist.

Thanks much!

Nicholas Kormanik


nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #1 on: March 08, 2012, 05:38 PM »
Perhaps named:

ClipSave


nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #2 on: March 10, 2012, 04:29 PM »
Never mind the zero-padding of file names, if that's going to cause a hold-up.  One can use other programs to rename the files after they are created.

I've searched the Internet.  While there are tons of clipboard programs, none offers the simple solution I am seeking -- to easily have Ctrl-C output go directly to a series of text files, one after the other.  No fuss no muss.

Go figure.

Anyone have a possible reason why such doesn't presently exist??


skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #3 on: March 10, 2012, 04:37 PM »
Nick, you did see that I added zero padding to Chopping List, right?

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #4 on: March 10, 2012, 04:42 PM »
Saint Skwire, I hadn't yet checked your latest iteration.  Good work!

What about the send direct to text files?  Thoughts?

Name "ClipSave" not even yet taken out there in Clip Land.


skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #5 on: March 10, 2012, 05:46 PM »
What about the send direct to text files?  Thoughts?

This is rather easy in AutoHotkey with a simple script.  In other words, I really don't want to make a full-fledged application out of it.  Consider this example (change the DestPath variable to suit your needs):

Code: Autohotkey [Select]
  1. DestPath := "c:\tmp"
  2. Startup := 1
  3. Return ; End of auto-execute section.
  4.  
  5.  
  6. OnClipboardChange:
  7. {
  8.     If ( Startup )
  9.     {
  10.         Startup := 0
  11.         Return
  12.     }
  13.    
  14.     FileAppend, % Clipboard, % DestPath . "\ClipSave_" . GenUniqueFilename( DestPath ) . ".txt"
  15. }
  16. Return
  17.  
  18.  
  19. GenUniqueFilename( sPath )
  20. {
  21.     Loop
  22.     {
  23.         If FileExist( sPath . "\ClipSave_" . A_Index . ".txt" )
  24.         {
  25.             Continue
  26.         }
  27.         Else
  28.         {
  29.             Return A_Index
  30.         }
  31.     }
  32. }

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #6 on: March 10, 2012, 06:07 PM »
AutoHotkey may be the answer, then.  Thanks!

Another option I've come across is one of NirSoft's offerings, "InsideClipboard."

http://www.nirsoft.n...nside_clipboard.html

With this tiny program one can use command line to save clipboard contents to disk.

HOWEVER, what is saved to disk is a .clp file -- the native clipboard file contents.

So..., I'll have to search for a way to convert .clp to .txt.


nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #7 on: March 20, 2012, 04:40 PM »
The solution I decided to use is a commercial program, Macro Express Pro.

It has the ability to send clipboard clips directly to named files.  Appears to work pretty well.

HOWEVER, a tiny efficient freebe by Skwire and Company probably would work better.

So..., until then, issue sorta solved.

Thanks.

Nicholas Kormanik

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #8 on: March 20, 2012, 05:47 PM »
HOWEVER, a tiny efficient freebe by Skwire and Company probably would work better.
So..., until then, issue sorta solved.

I'm confused because my code snippet above does what you asked for, no?
https://www.donation....msg281503#msg281503

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #9 on: March 20, 2012, 05:51 PM »
You might find that Horst Schaeffer's freeware ClipText has a place in your workflow:
ClipText copies plain text from the Clipboard to a file or from a file to the Clipboard.

Examples:
    ClipText to "My File.ext"
    ClipText from %temp%\my.txt


In case a text file with OEM (console) characters is to be read or written, option /OEM ensures that extended ASCII characters are handled properly.

Text can be appended to the Clipboard or to the file with the /append option.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #10 on: March 20, 2012, 07:28 PM »
Cliptext is, indeed, elegant and simple.  Surprised Google didn't turn it up in my searches.  Thank you!

Whether it is as good as Skwire coding is the question.  What I had asked for initially was auto-numbering/naming of the files, so for every Ctrl-C hit the output automatically gets added as next text file in designated subdirectory.

Here's how I'd use Cliptext:

Run macro:

(steps and text highlighting)

Ctrl-C
text_001.bat

(other steps and text highlighting)

Ctrl-C
text_002.bat

(other steps and text highlighting)

Ctrl-C
text_003.bat

=====

with the batch files being, respectively:

ClipText to "C:\1\text_001.txt"

ClipText to "C:\1\text_002.txt"

ClipText to "C:\1\text_003.txt"


rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #11 on: March 21, 2012, 04:45 PM »
You could use ClipText with a bit of batch file magic, using another of Horst's programs, LMOD, which can be used to renumber files.  Or just a simple batch,

if exist foo1.bar ren foo1.bar foo2.bar
cliptext to foo1.bar

etc.  You could presumably set a Windows shortcut for the batch file.  This would work as you're going along.  If you can accumulate all the clips you want, and only then export them all in one go, there are other possibilities.

The first one that came to mind involves money.  Try the NoteFrog™ version 2 Customer Preview.  Turn on Options -> Turn ON automatic clipboard capture.   Capture your clips.  When done, Stack -> Save Active Stack contents as individual items.  If you set, say, "out.txt" as the output file, you will get a file out.txt that contains a summary of all the clips, but also a set of files out0.txt, out1.txt, out3.txt, etc. which will contain each clip in a separate file.  This only works with NoteFrog v2 preview, it isn't in current full release 1.9.5.  They currently have a special offer of $19.95 for all future upgrades.

That idea made me look a little farther - and it turns out you don't need to pay anything!  You can do the same thing with my regular clipboard enhancer, ArsClip.  Suggest you try the 3.2.3 test 8 beta, the one I'm using now (the version 4 betas are early, not everything works yet).  This works similarly to the NoteFrog example above, but ArsClip is free, with donation possible.  Once you've accumulated your clips, popup ArsClip, System -> Edit History, and mark the clips you want to export from there.  The file names are always PopupClip0001.txt, PopupClip0002.txt, etc. and it looks like you can't change the base name, but you could use your file renamer of choice if you need to do that.   It may help to go into Configuration and adjust the number of clips in the popup to avoid having to go into Removed Clips as well as current ones.

Here on DC, mouser's ClipboardHelp+Spell (CHS) can export marked clips, but apparently only to a single CSV file.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #12 on: March 21, 2012, 04:56 PM »
Thanks for your thought-filled reply.  At your suggestion I'll give ArsClip a try!


rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #13 on: March 21, 2012, 04:58 PM »
Hope it works for you.

My thought processes are somewhat sluggish   ;)  here's another thought.  

If you only have a small number of predefined files, here's another Horst Schaeffer program that doesn't seem to be on his Web site any more: ClipTX.
ClipTX 0.10 - Clipboard to file
-------------------------------

ClipTX appends (plain) text from the clipboard to one of several predefined target files. ClipTX only acts on hotkey or mouse click (no automatic collection). The "Quick save" function (hotkey or click on system tray icon) saves the clipboard text to the default target file.
It's very small, so I've attached it.

However, if I understand things correctly, ArsClip might be your best bet.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
Re: Ctrl-C direct to sequential files in designated folder
« Reply #14 on: March 21, 2012, 05:02 PM »
Good to keep these gems on hand, huh.  One never knows....