Lesson learned: Do not alias a Mastodon instance username to your Micro.blog Mastodon-compatible username and then decide to change it back. You will lose your original Mastodon instance followers, though you will keep your Micro.blog followers…
📷 Sunrise over Terminal Island.
Going to try to wrap my head around Hugo themes today. I get the gist of it, but after 20+ years of WordPress theming, the logic is just a little different. Any good references appreciated. My brain is not as pliable as it once was.
I’ve yet to start playing with the macOS Sonoma beta, but in my Apple fanboy opinion, the default desktop wallpapers are some of the best Apple has produced in the past several releases.
I try to diligently plan the tasks I want to get done each day, but there’s always a fire that has to be put out, pushing the planned tasks to the next day - until they become fires of their own.
Tomorrow is a new chance. I’ll just keep telling myself that…
Upped my Micro.blog plan to the premium level over the weekend. Great to have the newsletter option now. Mulling some potential topics for a regular Microcast as well.
📷 Across the Irvine valley.
Purchased a license for Shottr, a macOS screenshot tool, based on a Micro.blog discussion thread I stumbled on and it’s probably the best $4 I’ve spent in a year. Normally it would be $8, but took advantage of the first week coupon code.
📷 Remembering those who gave it all for our freedom.
📷 HB Northside Lineup.
If you have multiple domains you’d like to redirect to your Micro.blog domain (or any domain for that matter), and know how to manage your own DNS records, I highly recommend using ForwardDomain.net as a redirect solution.
📷 Blooming cactus.
I’m struggling whether I should stick with Micro.blog as an additional platform at my jimmitchellmedia.net domain. It’s great and has a nice community, but I keep coming back to one blog to rule them all – this one. Hopefully I can make a decision by the end of the long weekend.
I’m developing a love/hate relationship with the Copado CI/CD platform for Salesforce deployments. When it works, it’s a dream. When it doesn’t, it’s a pain to figure out why.
I’ve been a WordPress user since the early days and have carried my content with me from one host to another. I think it’s time to put the old content to rest and start fresh with micro.blog.
No, my esteemed co-worker… I will not “give” you a login into the system I’m responsible for to “poke around.” Would you give me access to yours to do the same? I doubt it. Good day, sir.
I’ve decided that I’m simply going to hibernate my Twitter account for now. I don’t plan to use it, but don’t want to lose it either. Maybe one day it’ll be worth tweeting again.
A Better AppleScript to Compress Files or Folders
Friday, April 14, 2023
A while ago, I created an AppleScript that allows you to compress files and folders by simply dropping them onto the applet. One of the readers left a comment asking for a way to achieve the following tasks:
- Select a folder from Finder.
- Store the folder name as “x”.
- Compress all files and sub-folders within the folder “x”, including their paths.
- Rename the resulting zip file as “x.zip”.
- Delete all the files that were used to create the zip file.
With the help of ChatGPT – and because I wanted to be lazy about it – I was able to come up with a solution to this challenge, which can be a great way to manage archives if that’s important to you.
I must admit that ChatGPT did a decent job in generating the AppleScript, but there were some bugs that I had to fix manually. Nevertheless, it’s both scary and exciting to have a tool that can generate usable code.
As always, you can run this script using FastScripts from your menu bar for quick and easy access.
-- choose files or folders to archive since AppleScript can't seem to allow both at once...
set archiveOption to button returned of (display dialog "Archive files or folders?" buttons {"Cancel", "Folders", "Files"} default button 3)
-- now let's choose what we want to archive...
if archiveOption is "Files" then
set selectedItems to choose file with prompt "Select files you want to compress:" with multiple selections allowed
else if archiveOption is "Folders" then
set selectedItems to choose folder with prompt "Select folders you want to compress:" with multiple selections allowed
else if archiveOption is "Cancel" then
return
end if
-- set the array of files or folders selected...
if the selectedItems is {} then
return
else if (selectedItems count) is equal to 1 then
set thePathFilename to the quoted form of POSIX path of (selectedItems as string)
else
set thePathFilename to {}
repeat with i from 1 to (selectedItems count)
copy (quoted form of POSIX path of (item i of selectedItems as string)) & space to end of thePathFilename
end repeat
set thePathFilename to thePathFilename as string
end if
-- coerce a date string for the archive name
set currentDate to current date
set yearStr to year of currentDate as string
set monthStr to (month of currentDate as integer) as string
if length of monthStr = 1 then set monthStr to "0" & monthStr
set dayStr to day of currentDate as string
if length of dayStr = 1 then set dayStr to "0" & dayStr
set currentDateStr to yearStr & "-" & monthStr & "-" & dayStr
-- next, let's name our archive, which defaults to "Archive" & the currentDateStr we just coerced
set archiveName to text returned of (display dialog "Enter a name for your archive:" default answer "Archive " & currentDateStr buttons {"Cancel", "OK"} default button 2)
-- then, let's choose where to save the archive and compress it with the shell "zip" command
set archiveFile to POSIX path of (choose folder with prompt "Choose a location to save the archive:")
do shell script "cd " & quoted form of archiveFile & " && zip -r " & quoted form of archiveName & ".zip " & thePathFilename
-- finally, let's delete the files we just archived if we decide we don't need them around anymore.
set deleteFiles to button returned of (display dialog "Do you want to delete the original files?" buttons {"Yes", "No"} default button 2)
set deleteOption to false
if deleteFiles is "Yes" then
set deleteOption to true
end if
if deleteOption is equal to true then
if selectedItems is not {} then
set fileList to {}
repeat with itemPath in selectedItems
set end of fileList to quoted form of POSIX path of itemPath
end repeat
repeat with fileItem in fileList
do shell script "rm " & fileItem
end repeat
end if
end if
That’s it. I’m done – for good this time. I’ve left Twitter and there’s no reason to go back, whatsoever. I’ve killed my account and am going all in on Mastodon. You can find me at https://mastodon.social/@jimmitchell if you make the move to the Fediverse yourself.
I switched over to micro.blog for a few days, thinking I might prefer to go that route over running my own VPS, but it’s just not for me. Publishing my own WordPress site is what works best for me, so we’re back.