On Jun 17, 2021, at 10:31 AM, Peter Small <[email protected] 
<mailto:[email protected]>> wrote:
> 
> To get over this problem I want to append a version number in a query line to 
> every document  i.e., by adding "?v=1.0" to the end of all the documents 
> (URLS, CSS and JS docs). I want to be able to do this first in a folder on 
> the desktop.
> 
> Can this be done as a batch with BBEdit? Or perhaps there is an Applescript 
> or Keyboard Maestro macro out there somewhere?

I assume your point is that you aren't actually changing the file names, just 
adding a query string to the anchors and links that refer to the. If so, here's 
a quick and dirty approach.

Make sure your query identifier string is unique across your entire site. Maybe 
“?reloadVersion=version” or something equally ugly.

Now just do a site-wide search-and-replace. Cmd-Shift-F to open the multi-file 
search dialog. Search string: “\?reloadVersion=[\d.]+“. Check Grep. Replacement 
string “?reloadVersion=yourNewVersionNumber”. Search in: Frontmost Project 
(assuming your site is kept as a BBEdit project). Click Replace All.

Specifying a new version each time is up to you. You can probably automate it 
with AppleScript, but probably not worth the time. But if you do want to do it, 
I'd suggest just using something like  "YYYYMMDDHHMMSS" for the version string 
— guaranteed unique, no cleverness required.

Regards,

        Neil Faiman

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/0DA59AF6-D2E2-4D6A-811D-488A4B4E880D%40faiman.org.

Reply via email to