topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • January 19, 2020, 10:00 PM
  • Proudly celebrating 14 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: Possible suggestion -- variables in clips  (Read 302 times)

oblivion

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 461
    • View Profile
    • Read more about this member.
    • Donate to Member
Possible suggestion -- variables in clips
« on: January 13, 2020, 06:05 AM »
I have an increasingly anachronistic tendency: I download podcasts rather than stream them, so I can use my MP3 player rather than my phone.

Some podcasts (particularly, it seems, those hosted by Acast), when downloaded from a link in an RSS feed, create files with really, really long and non-readable filenames.

One of them (a new, daily podcast that started at the beginning of the year -- The Last Post, with the remarkable Alice Fraser) is, because it's daily, creating for me a need to have a naming strategy for the things so I can (a) recognise them from everything else, and (b) not overwrite one I haven't got round to listening to yet with today's.

So I have a clip in CHS that pastes "lastpost200101" and I then just have to modify the date part of that to reflect the current download.

So here's an idea: what if a clip could embed a query variable, possibly with a default value, so I could paste the above but have it ask me for the date part of the string before performing the paste?
-- bests, Tim

...this space unintentionally left blank.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,398
    • View Profile
    • Donate to Member
Re: Possible suggestion -- variables in clips
« Reply #1 on: January 13, 2020, 02:07 PM »
You could use a custom date ('R - Time/Date TextClips' from the Quick menu of CHS, the extra format can be set on the 'Quick Paste Pop-up Menu' page in the settings), adding one in your desired format, lastpost%y%m%d would be the closest to your proposal I can think of, or replace %y with %Y for a 4 digit year.

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 3,066
    • View Profile
    • Donate to Member
Re: Possible suggestion -- variables in clips
« Reply #2 on: January 13, 2020, 03:02 PM »
Are your podcasts common file types like MP3, and if so, do they contain metadata tags?  If the answers to both are Yes, you might try a different approach.  Some of the better bulk file renamers can read metadata, and use it to rename files, which would do the job for you.  Examples include Rename Master (RM) and Bulk Rename Utility (BRU).  You can operate RM from the command line, which would mean you could add the same author's NewFileGo automation utility to watch for new files and invoke RM on them, perhaps as a scheduled event.

oblivion

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 461
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Possible suggestion -- variables in clips
« Reply #3 on: January 13, 2020, 05:59 PM »
You could use a custom date ('R - Time/Date TextClips' from the Quick menu of CHS
In all my time using CHS, I've never ever used the Quick menu.  ;D And while I was hoping for a more general-purpose kind of solution (on the basis that I could probably find lots of other things I could do with a facility to populate and use a variable on the fly) this might very well solve this problem for me -- thanks!  :up:
-- bests, Tim

...this space unintentionally left blank.

oblivion

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 461
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Possible suggestion -- variables in clips
« Reply #4 on: January 13, 2020, 06:09 PM »
Are your podcasts common file types like MP3, and if so, do they contain metadata tags?
I used to use RenameMaster for something else entirely and had entirely forgotten its existence. And the Bulk Rename thing -- I used that to pull info out of long filenames and get them into an 8.3 format for a gateway process I designed nearly a decade ago, and I'd forgotten about that one too. :)

The approach is not unreasonable, and I hadn't thought of it! I could probably also do something like this in XYplorer too. But my preference is to create the file with the right name (by overriding the name Acast presents me with in the DownloadStudio save file dialog) if I can as it's then a single stage process with just a minor intervention.
-- bests, Tim

...this space unintentionally left blank.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 39,819
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Possible suggestion -- variables in clips
« Reply #5 on: January 15, 2020, 02:38 AM »
I like the idea of a paste with the program asking for variable to replace before pasting.. It wouldn't be very hard to add.. The real question is whether it would be smarter to write it as a built-in function or whether it would be better to have a way for CHS to be told about a standalone exe it should invoke to paste certain formatted clips, and let the 3rd party tool do the prompt for variables followed by replacement and paste..
« Last Edit: January 15, 2020, 02:44 AM by mouser »

oblivion

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 461
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Possible suggestion -- variables in clips
« Reply #6 on: January 15, 2020, 07:51 AM »
I like the idea of a paste with the program asking for variable to replace before pasting.. It wouldn't be very hard to add.. The real question is whether it would be smarter to write it as a built-in function or whether it would be better to have a way for CHS to be told about a standalone exe it should invoke to paste certain formatted clips, and let the 3rd party tool do the prompt for variables followed by replacement and paste..
Playing with the existing functionality here, I've built myself a working (if slightly clunky) solution and I think maybe what's there could be refined just slightly.

The %customdate% variable and a template is the route I took: effectively pasting a predefined string followed by the %customdate% variable, where I've defined customdate to take the format I want. It's okay but only if I only download one podcast from that series on any given day, in its current form... and, of course, I have to invoke it by shift-clicking on an entry and picking it from a menu.

The alternative approach that I couldn't make work was using the modify format/case functionality -- there's an option to add a date at either the top or bottom but not without including a line break.

But I still like the idea of a prompt for a variable that might populate a named variable like customdate, and I also wonder if a counter variable similar to the one you use for filenames in ScreenshotCaptor might be a useful thing for filenames too. It feels to me like a standalone exe to be called might be overkill, but I'm not the programmer here, just someone who treats the clipboard like his personal slave :)
-- bests, Tim

...this space unintentionally left blank.