DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Possible suggestion -- variables in clips  (Read 7,011 times)

oblivion

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 499
    • Participated in NANY Challenge Once
Possible suggestion -- variables in clips
« on: January 13, 2020, 12:05 PM »
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,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: Possible suggestion -- variables in clips
« Reply #1 on: January 13, 2020, 08: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.
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 3,217
Re: Possible suggestion -- variables in clips
« Reply #2 on: January 13, 2020, 09: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: 499
    • Participated in NANY Challenge Once
Re: Possible suggestion -- variables in clips
« Reply #3 on: January 13, 2020, 11: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: 499
    • Participated in NANY Challenge Once
Re: Possible suggestion -- variables in clips
« Reply #4 on: January 14, 2020, 12:09 AM »
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: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Possible suggestion -- variables in clips
« Reply #5 on: January 15, 2020, 08: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, 08:44 AM by mouser »

oblivion

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 499
    • Participated in NANY Challenge Once
Re: Possible suggestion -- variables in clips
« Reply #6 on: January 15, 2020, 01:51 PM »
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.

Original address: https://www.donationcoder.com/forum/index.php?topic=49383.0