NC_2023_12_31

Apologies for schedule confusion, no live show on Jan. 7th. New Auphonic feature: AI transcripts with chapters. Discussion on JQ queries, OCR on PDFs. Exploring dark patterns in CS, personal experience. Support the show!

2021, Allison Sheridan
NosillaCast Apple Podcast
http://podfeet.com

Generated Shownotes

Chapters

0:00:00 NC_2023_12_31
0:00:55 CCATP #783 — Bart Busschots on PBS 158B – jq More Advanced Queries
0:04:19 OCR PDFs using Free Open Source Tools with Apple Shortcuts (or Automator)
0:28:11 The World’s Most Expensive Sour Raisins – a Story of Dark Patterns

Long Summary

In the last episode of our show, we apologize for the confusion regarding our schedule and announce that there won't be a live show on January 7th due to our attendance at CES in Las Vegas. We assure our listeners that we'll be back with exciting interviews and adventure stories the following week. We also highlight the new enhancement to our show - Auphonic, the service we use for audio file processing, can now generate AI transcripts with auto-generated chapters. These chapters allow users to jump to specific topics in the audio file using the transcript. We acknowledge that the chapter marks may not be perfect, but they are a useful tool for finding desired content. Moving on to the main topic, we continue with the second half of the Programming by Stealth episode, focusing on queries using the JQ language on JSON files. Bart explains the contains and inside functions for searching JSON files with JQ, covering testing for containment with strings, arrays, and dictionaries, default containment, and using regular expressions. Additionally, we discuss methods of running OCR on PDFs using free open-source tools. We provide instructions for downloading and using a super simple Quick Action shortcut using shortcuts on macOS, which involves installing OCR MyPDF through Terminal and enabling scripts and shortcuts in shortcut settings. We further delve into the process of creating the shortcut, encountering challenges with the path to the Homebrew library and finding solutions on Stack Overflow. We encourage users to try and find solutions themselves and share our experiences testing the installation of OCR MyPDF on different systems. We mention the comment feature in Keyboard Maestro and the lack of a similar feature in Automator, explaining the workaround we found using Set Spotlight Comments for Finder Items to add comments to Automator actions. We also mention adding a sound notification to the workflow based on a tip from BartB.ie's blog post. After discussing the installation and testing, we provide instructions for users to install Homebrew, OCR MyPDF, and the quick action workflow in their user library services folder and enable Full Disk Access for Automator. We guide them on how to use the quick action on PDF files in Finder. We then shift gears to the topic of dark patterns in computer science and human-computer interaction. We define dark patterns and discuss their deceptive nature in manipulating user behavior. The main speaker confesses falling victim to a dark pattern which resulted in a financial loss related to purchasing sour raisins from an online website. They emphasize the importance of portion control and share their experience of ordering snacks in single-portion packages to avoid overeating. They discuss their attempt to buy sun-made sour raisins from a website that claimed to sell them but missed some suspicious details. They recount receiving an email regarding an unexpected charge for a pro membership and free shipping, realizing they unknowingly signed up for it. Despite contacting the bank and the company, they were unable to obtain a refund. They reflect on the lessons learned, including the importance of reading the fine print, paying attention to follow-up emails, and being cautious when making purchases online. They also discuss the convenience of Apple subscriptions and the limitations of Apple Pay. They warn listeners about misleading website domains and the tricks behind dark patterns. Finally, they wrap up the episode by reminding listeners to reach out with any questions or suggestions and provide information on how they can support the show and join the community.

Brief Summary

In our latest episode, we apologize for the schedule confusion and announce that there won't be a live show on January 7th due to our attendance at CES. We introduce the new feature of Auphonic, our audio processing service, which now generates AI transcripts with auto-generated chapters. Moving on, we continue our discussion on Programming by Stealth, focusing on JQ queries and running OCR on PDFs. We then explore dark patterns in computer science and human-computer interaction, sharing a personal experience. We conclude by encouraging listeners to reach out and support the show.

Tags

latest episode, schedule confusion, live show, January 7th, CES, new feature, Auphonic, audio processing service, AI transcripts, auto-generated chapters, Programming by Stealth, JQ queries, running OCR, PDFs, dark patterns, computer science, human-computer interaction, personal experience, support show
Edit Transcript Remove Highlighting Add Audio File
Export... ?

Transcript

NC_2023_12_31


[0:00] Music.

[0:06] Geek Podcast with an ever so slight Apple bias. Today is Sunday, December 31st, 2023, and this is show number 973.
Yes, it's the last show of 2023, which I'm guessing most of you will hear in 2024.
I'm here all by my lonesome tonight without the live audience, but you know, we must soldier on.
Before we kick into the show, I wanted to let the live audience know that we will not have a live show on Sunday, January 7th, because Steve and I will be at CES in Las Vegas.
I was kind of hand-wavy about this at the end of last week's show because I hadn't yet looked at the calendar to see where I'd be.
I'm sorry about that, and I will miss you. You know I miss you guys.
In fact, right now, recording by myself is so lonely, but we'll be back with tales of adventure and lots of great interviews the following week.

CCATP #783 — Bart Busschots on PBS 158B – jq More Advanced Queries

https://www.podfeet.com/blog/2023/12/ccatp-783/


[0:55] Two weeks ago, Barbu Shots and I recorded a Programming by Stealth episode covering more queries using the JQ language on our JSON files.
We spent so much time working through the challenges from the previous installment that we only made it halfway through his tutorial show notes.
So this week, we're back with the second half of that episode, Programming by Stealth 158b.
But before we got to start learning, I alerted the audience to a significant enhancement to the material we create for this show, and it's going to be interesting for the NoCilla cast, as well as chit-chat across the pond.
I use a service called Auphonic to do a lot of things with the audio file when we're done recording, including leveling the audio, adding metadata to it, and converting it to an mp3 and then FTPing it up to the server for the listeners to download.
Auphonic has recently added AI generated transcripts, which we've had for a while and I've told you about with Programming by Stealth and with the other shows.
Now the Nosilla cast has chapter marks that you can use to jump to content in the audio file, but Chitchat Across the Pond has never had that.
Auphonic now adds auto-generated chapters based on the content in the audio file.
These chapter marks are in the transcript as well, which allows you to jump to the text of where we cover a specific topic.
Not only that, these auto-generated chapters are in the audio file, so in your podcatcher, you can now jump to different sections instead of having to scroll through to find something BART Explained or we talked about in another episode of Chit Chat Across the Pond.

[2:23] The chapter marks are not perfect, and we have no intention of editing them, but it should give you an easier way to find what you want to re-listen to or re-read.
While BART has spectacular tutorial show notes, and there are sometimes notes for Chit Chat Across the Pond episodes, the transcript gives you the full flavor of the conversation we have, especially while BART is teaching me.
A perfect example is how we worked through the challenges from the previous week, and that was very, very brief in the show notes, but in conversation, it was actually quite long.
So you might get a lot of value out of going and rereading the section in the transcripts.
Now, it was interesting when George from Auphonic first created this method of having these auto-generated chapters, it actually overwrote the chapters in the Nocilla cast last week.
I don't know if anybody noticed that, but for a brief period, it was incorrectly encoded with the wrong chapter marks.
But I talked to George and I told told him what happened, and he said, oh man, that's not supposed to happen.
He fixed Auphonic and he reran it, and I was able to fix it in the show, I think.
But anyway, whether you got it right or not back then, going forward, they will be perfect.

[3:33] Okay, now back to this week's show in Chit Chat Across the Pond with Bart Bouchats.
In this week's episode, Bart explains two powerful commands for searching JSON files with JQ.
He uses the contains and inside functions. In this context, he goes through testing for containment with strings, arrays, and dictionaries.
Then he tells us about default containment.

[3:54] Next, he explains how the inside function does essentially the opposite of testing for containment.
Finally, he shows us how to use regular expressions with the test function to get as granular as we like with our JQ filters.
You can, of course, always find Bart's fabulous tutorial show notes over at pbs.bartofisser.net, and you can read the transcript at podfeet.com or at pbs.bartofisser.net.

[4:19] I've been talking a lot lately about different methods of running optical character

OCR PDFs using Free Open Source Tools with Apple Shortcuts (or Automator)

https://www.podfeet.com/blog/2023/12/ocr-pdf-quick-action/


[4:23] recognition, or OCR, on PDFs using only free open-source tools after George from Tulsa taught us about OCR MyPDF.
All of the methods I've described work, but you know, to be honest, they're pretty high on the nerd scale.
Instead of having to run a shell script or buy and configure keyboard maestro, what if you could just right-click on a file and choose Quick Action to OCR all your files for free?
Wouldn't that be the best possible solution?
As you might expect, I want to tell you the story of how I finally made this super simple quick action using shortcuts on macOS.
But if you want to just get to the shortcut and not follow along with my adventure, this time I'm actually going to give you the instructions up front.
After you download the shortcut from the link in the show notes, read the instructions in the shortcut, or you're going to be very sorry and sad when it doesn't work.
The instructions tell you how to download two things using Terminal, but after that it should be clean sailing.

[5:22] Okay, I know you've gone over and you've downloaded the shortcut and you've double-clicked in it and didn't do anything because you're not going to read the instructions that I told you to in the shortcut.
Here are the first two required steps.
If you don't already have it, install Homebrew. All you do is go to brew.sh, you copy the command they tell you to copy, and there's even a little copy button for you.
Open Terminal, paste, and hit enter.
Ignore all the glop that flies by on your screen. The second step is to install OCR MyPDF.
In Terminal, type brew install OCR MyPDF. That's it.
Ignore the even more voluminous pile of glop that will fly by your screen unless you see some errors.
Now once you've got that done, when you try to run the quick action from the shortcut, you may get a notification saying that it didn't work because you haven't enabled running scripts and shortcuts.
Simply open shortcut settings and on the advanced tab, check the box that says allow running scripts.

[6:19] Now, you might wonder why am I doing this a third time, but you may remember at the end of the last story where David Roth was finally able to run the Keyboard Maestro macro to OCR his files, and I then asked him, is there anything else you'd like?
That's when he said, I don't normally run Keyboard Maestro. Could I do it in a more native way where I didn't have to run Keyboard Maestro?
Well, that's when I decided to try to do it with a quick action, which is what Mike Price said I should do way back at the beginning.
As I go through my story of discovery, I'm going to actually explain two paths I went down, both of which create a quick action where you can just right-click on a file, but the shortcut method is actually the easiest method, I think, for the normal user.

[7:02] For my first path to create a quick action, I use the application Automator.
While Automator isn't the shiny new kid on the block for automation, it can still get the job done.
I've mentioned before that Apple have been terrible about changing the names of things and not doing a thorough job of it so you end up with half old names and half new names.
That becomes very obvious in working with Automator to create quick actions.
The inconsistencies can get very confusing. When you launch Automator, you'll see a set of eight different file types to choose from, including Workflow and Quick Action.
You want to choose Quick Action because the resulting file will automatically be saved into the correct location to be opened as a Quick Action, so that's handy.
But I mention Workflow because when you save your Quick Action, the file type will be, get this, .workflow.
To access Quick Actions, you right-click on a file and finder and you choose Quick Actions.
But in the not-so-distant past, you used to right-click and choose Services.

[8:01] Guess where Quick Actions are stored? They're stored in a folder called Services in your home library.
Seriously, Apple, could you just pick one name and just stick with it or at least change it everywhere when you do this?
All right, I'm going to stop whining about that. With Quick Action chosen as the document type in Automator, we can drag in what are called actions from the center column and build up a little workflow.
The main basis for a quick hash in will still be the little bash shell script that I wrote.
You'll remember that the basis for all of the methods I've worked on so far to create an OCR of a PDF is the shell script that runs the open source library OCR MyPDF that we learned about thanks to George from Tulsa.
I dragged in a run shell script action to my workflow in Automator and I pasted in my shell script.
The shell script will try to run OCR MyPDF, so just like the previous solutions that we talked about in the other episodes, we need to tell Automator the path to find this Homebrew library and all of its dependencies.
On my Mac, Homebrew installs in the directory slash opt slash homebrew slash bin, so I hard-coded the path to the command OCR MyPDF with that path.
I thought I was very clever, until I stumbled across a tiny tidbit of important information. information.
Evidently, the folks at Homebrew made a decision to have Homebrew install libraries in a different location on Apple Silicon Macs than on Intel Macs.
On Intel Macs, it installs the libraries in slash user slash local slash bin.

[9:30] Well, I had a choice at this point. I knew how to get it working for Apple Silicon Macs, so I could abandon all of my Intel owning friends and not let them play along with OCRing their PDFs for free with a quick action, or I could try to figure out how to run it.
It may be an if-then statement in my shell script that checked which type of machine was running the code and to use the appropriate path to the homebrew libraries for Apple Silicon versus Intel.

[9:57] I quickly found several solutions on Stack Overflow for how to query the system to find out which processor was inside the Mac running the shell script.
Klaus Melbourne was even kind enough to put the command inside an if statement so it was all written for me.
I gotta tell you, I love the internet and especially the open source community.
The terminal command to determine your processor is pretty easy and kind of cool.
It's fun to play with. It's simply uname-p. If you're on an Apple Silicon Mac, that command will return arm, and if you're on an Intel Mac, it'll return something a little more specific, such as i386.
I created an if statement using Kloss's beautiful example that checks to see if the command returns arm, and if it does, it sets the variable homebrew path to slash op slash homebrew slash bin for Apple Silicon Macs.
Otherwise, no matter what else spits out from that command, uname-p, it sets the the variable homebrew path to slash user slash local slash bin.

[10:58] At the end of my script where I actually run OCR in my PDF, I can slap that variable name I created, homebrew path, on the front of the end of the command, and no matter what kind of Mac you're running on, this should work.
This would be a much cleaner way to run my keyboard maestro macro too, so I probably should go back and fix that. We'll see if I do.
So I said it should work, and it did for some Intel to Intel Macs and all Apple Silicon Macs that I had people use to test.
However, when Dorothy tried to run it on a 2015 Intel Mac running Big Sur, which is no longer supported, the OCR MyPDF library simply wouldn't install.
The error was pretty curious.
Remember I said that installing the library OCR MyPDF would install lots of dependencies?
One of them was downloaded with a mismatch of the SHA-256 encryption.
I think I understand what this means. It could mean, if it's not matched, that something has gone wrong, like it could be that the older library required for the older Macs had some bad stuff injected into it.
Or maybe it's been moved, or the name has been changed, but we really don't know what's wrong with it, so we really couldn't have a path forward to make this work for Dorothy's older Mac.

[12:13] I also tested it on my 2015 MacBook Pro Adorable, which is an Intel, what is it?
It's some really awful little processor, and I got the same error.
Now, it's not the age of the Mac that makes it not work because Steven Goetz has a Mac mini that's 2015, but it is supported up to, I think it was Monterey, and it does work.
But going back to the MacBook Adorable and Dorothy's 2015 iMac, the Homebrew installer sent this clarifying message. It said.

[13:13] Media. You may ask for help in Homebrew's discussions, but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a poll request.
We will review it, but we may or may not accept it.
Now, here's a fun little tidbit. After this happened, Dorothy and I chatted quite a bit about what some solutions would be for her to get a new Mac, and she sent me a photo of her new Mac Mini just the other day.
Now, I did ask Ed Tobias and, and as I mentioned, Steven Goetz, to try installing on their more recent Intel Macs running fully supported OSes, Monterey, and the installation of OCR MyPDF worked just fine. This was great news.
I now had a script that ran successfully on both Intel and Apple Silicon as long as the operating system was fully supported.

[13:58] Now, I like to document my programs, and I mentioned to you that in Keyboard Maestro, there's an action you can drag in called Comment, and it lets you add documentation.
What I really like is you can even color code the actions. So I've got the requirements being that you've got to do some of these things, like installing OCR MyPDF, so I made the comments section red so people would be sure to notice the importance.
Sadly, Automator doesn't have any actions designed for commenting your work. work.
I went on the hunt for how people put comments into Automator because I figured they must, and I found all sorts of recommendations.

[14:32] Sounds funny, but most people recommended using shell script actions, but making every line of the shell script a commented out line of code.
Talk about a clumsy workaround.
I went down a slightly different path, but it's pretty close to just as silly.
I used the action Set Spotlight Comments for Finder Items. That gives you a freeform text field so you don't have to sit there putting little double slashes or hashes or anything to make commented outlines.
So in that freeform text field, you can put in your comments.
It works, but this also does what it says on the tin.
It puts these comments you've written from Automator into the spotlight comments for the input file.
I didn't want the input file to be changed at all, so I came up with a hacky way around the problem.
I noticed that this action had a little checkbox to allow you to append your text to existing comments. That gave me a workaround idea.
First, I wrote out my requirements and my setup instructions in one set spotlight comments for finder items action, but then I followed it with another set light spotlight comments, but I put no text at all in it.
By unchecking the append existing comments checkbox, I knew it would erase what the first action wrote.
I felt rather clever coming up with that idea. Now, technically, I am touching that input file, and maybe you don't want that, because now the modified date has changed, but it was a workaround, I say.

[15:54] There's really not that much else to my automated workflow quick action other than setting a few things at the very top of the automated workflow.
They're not critical to be set this way, but I set the workflow to receive the current PDF file in finder.app.
I gave it a little image icon and I set it to pink.
I'm not sure why that's an option, because everything is pretty much in grayscale in macOS these days, so the pink is kind of a lie, but it made me happy for a minute.
The last thing I added was a sound to be played when the quick action completes.
When I didn't have any success finding a play sound action in Automator, I turned to the Googles as one does.

[16:32] Imagine my delight when the very first hit I got on my query was to BartB.ie and a post he wrote on August 30th, 2014 entitled Play a Sound in Automator.
I distinctly remember him writing this because he'd been teaching me something in Automator in, boy, it must have been taming the terminal back then, and I wanted a sound to notify the user when it was done.
So he wrote this blog post after he figured it out.
The basic trick of it is you tell Automator to get specified finder item and drag in one of the built-in system sounds like glass.aiff.
That's the sound things usually make when they're finished. Once Automator has the sound you want to hear, you run a tiny bash shell script that I'm not going to read out loud here because it's just going to sound like gibberish, but you can see it in the show notes.
I saved my quick action, and now when I right-click on a PDF in the finder and I go to Quick Actions, I can see my OCR My PDF quick action.

[17:26] That's a lot of quick actions there, but you follow what I mean.
Anyway, my quick action churns for a bit, and then a new file appears with dash OCR appended to it to identify the new searchable and accessible PDF.

[17:38] The only thing left was to find some guinea pigs to test my shiny new quick action.
David Roth was the one who asked for an easier way, so he was giddy with excitement when and all he had to do was right-click on a PDF and choose OCR My PDF from the Quick Actions menu, and the magic happened.
You know, his happiness is what I live for.

[17:57] Now, if you'd like to use the Quick Actions built by Automator, here's the steps you have to follow, and it's going to be a little more complex than what you're going to hear when we talk about the shortcut version.
First of all, you have to install Homebrew, as I described earlier, and you have to install OCR MyPDF. Those are going to be the requirements for any of these paths.
Next, you have to download and unzip the workflow that I've put in the show notes, and you have to put it in your user library services folder.
I'd also open it in Automator to make sure it's legit. And of course, if you open it in Automator, you can see the instructions that I've given on installing Homebrew and OCR My PDF.
Next, go to System Settings, Privacy and Security, Full Disk Access, and make sure that Automator shows Full Disk Access toggled on.
Now, when I looked for it, I didn't see Automator under Full Disk Access, so use the plus button to add it if it's not there, and then toggle it on.
Next, select a PDF in Finder, right-click, select Quick Actions, and then select OCR My PDF.

[18:57] You may not see OCR My PDF in your Quick Actions.
If you don't, select Customize from the Quick Actions menu, and you'll be able to add it so that it shows up in the menu.
It's kind of cool because you can turn these Quick Actions on and off for their visibility, I should say. So that's kind of a neat feature.
You will also get a pop-up when you run this saying that Python 3.12 would like to access files in your desktop folder.
Evidently, Python gets installed and is part of this process, but I'm not entirely sure why it surfaces now.
But if you want to proceed, you're going to need to click OK.

[19:32] I've mentioned several times that quick actions are available by right clicking on a file, but there's another way to execute a quick action.
If you happen to like the column view in Finder, and you should like that view because it is the best view, when you select a file, you can see a preview of the file and below that you'll see some tools.
One of them is a quick action button, and if you don't have other quick actions that have to do with PDFs in Finder, you should see OCR My PDF as a simple button.
This saves you from all that tedium of right-clicking.
After my success using Automator, I sent my fabulous new quick action to Ed Tobias to show off.
After he played with it, he created a shortcut instead to run the OCR My PDF command.

[20:16] Ah, dag nabbit, I was ready to declare victory, but now I had to learn how to do with a shortcut, too.
While I'm compelled to thank him for sending it to me, and coming up with a better name than mine, to be honest, his script was a single line hard-coded to his machine.
It didn't have the elegance of my solution.
But it did give me a kind of a framework for how to write a generic shortcut for you, though.
This was crucial because I find shortcuts baffling, and I've literally never gotten any of them to work on my Mac.
The first step of Ed's shortcut was to tell it to receive the file.
Well, that seems like a reasonable place to start. The action he used said, receive PDFs and apps input from share sheet comma quick actions.
All right. I searched the action list for receive to find the one that Ed had used.
Guess what? Not one single action in the entire list of shortcut actions has the word receive in it.
This is what I really hate about shortcuts.
After a lot of time searching the net, messing around shortcuts, I had an idea.
Since the second action will be to run shell script, maybe the script itself triggers the creation of the receive action.

[21:25] So I was able to find a shell script action, and when I dragged it in, it informed me that I had to enable scripting actions in preferences, not settings, if I wanted to actually add or even run a script.
I mentioned this when I described how to run the shortcut at the beginning, but this is where you may need to know about it if you have to write your own.
Now, I mentioned that it says preferences, but when you open it, it is, of course, called settings. Thanks, Apple.

[21:51] Alright, once I had allowed scripts in shortcuts, the run shell script block changed magically to create a little hello world script.
Among a few other dropdowns, one was for input, with the selection helpfully set as input.
As soon as I changed the input dropdown to shortcut input, an action was inserted before my run shell script called receive.
While I was pleased I'd figured it out, that was awfully unintuitive.

[22:17] The rest of the receive action includes changing what to receive, where the input should be coming from, and what to do if there's no input.
Now that I had the receive action, I needed to narrow down the types of files it would accept.
By default, it had 19 different file types with selected checkboxes.
I hit the select all button, hoping it would change to a deselect all button, which it did, and that allowed me to just select PDFs as the input type.

[22:44] Input from was the next field to change. I wasn't sure what it meant until I selected it, and then I learned it was how to allow you to run the shortcut.
This opened the details tab with the info pane on the right-hand side.
There are a lot of good options here, and I saw no reason not to give you as many as seemed useful.
I checked pin and menu bar, show and share sheet, and used this quick action both from Finder and from the services menu.
The share sheet sounded fun because think about it right at the point when you've opened a PDF and you realize it's not searchable, you could go to share and choose the the shortcut and create your new OCR version of the PDF, having never left the file.
Having it in the menu bar sounded like fun too.
Well, I'm going to spoil your joy here. While the share sheet option appears to run the shortcut, up to and including playing the sound to tell you that it's done doesn't actually create a new file that's been OCR'd.
The menu bar option is even worse. With the PDF selected in Finder, using the menu bar method to get to the shortcut causes causes it to fail asking you to select a PDF, like it's lost the focus somehow.
For now I've disabled it for both the menu bar and the share sheet, but if anyone knows a solution to get it working, I'll fix it and put those options back.

[23:55] The last piece of the receive action gives you the option to choose what to do if there's no input.
I chose stop and respond and set the response to, please select a PDF you would like to OCR.
Remember I just said that using the menu bar asks it to select a PDF?
That's where that question comes from.
All right, now I can finally work on the script part of the shortcut.
After pasting in my script, I set the shell dropdown to bash.
I changed the pass input dropdown to as arguments.
This was critical so that my file name that came in from the receive action would actually be available to the script for manipulation and running the OCR my PDF command manned against it.

[24:36] I've gone into a great level of detail, as I always do, so let's describe succinctly the simple steps I followed.
I dragged in a run shell script option, and I ensured scripting was enabled in shortcuts.
Next, I changed the input to shortcut input in the run shell script action.
I changed the auto-created receive input actions to accept the file types desired, and I wrote the response if no file was supplied.
I changed the shell script, script—this is getting hard to say—I changed the shell script dropdowns to correspond to the shell I was using and how to handle inputs.
At this point, my shortcut actually worked.
But of course, I didn't stop there. Remember I stressed earlier the importance of documentation with comments?

[25:17] In Automator, I had to hijack a nonsense action to put in comments, but in a sign that Shortcuts is in more active development, there's actually a comment action you could drag into your shortcut.
It wouldn't let me change the color the way Keyboard Maestro does, but it's still better than Automator.
Even though the shortcut was functioning, I still wanted to have that little sound to tell the user that it was finished.
In Automator, I had used Bart's instructions to play the sound glass.aiff from the system library using a tiny bash script.
I could have done the same thing here, but my goal in this exercise was to use as much native functionality of shortcuts as possible, so I searched for sound in actions.
I was rewarded with a play sound action.
Since Glass.aiFF is a system sound, I expected that I'd be able to simply point the play sound action to that file in Finder, but play sound didn't have that option.
My options were select variable, clipboard, current date, device details, shortcut input, detail, let's see, shell script results, and clear.
How those are sounds, I'll never know. It was obvious I would have to work backward again.

[26:25] I played around with several of the options, like Select Variable, but none created an input action before the play sound action.
I took a chance, and I set the play sound action to Shortcut Input, and then I dragged the glass.aiff file in from Finder, and I dragged it before play sound.
This was the trick to telling play sound how to play the correct audio file.
Though it works perfectly, it looks a little bit weird.
It shows the full path to the file, which is system slash library slash sounds, but then it says the sound file is called glass.aiff.aiff.

[27:04] I have no idea why. It's just another weirdness in Apple land, I guess.
At the end, I named the shortcut OCRit, which is stealing Ed's name that I like better, and then I was able to easily copy an iCloud link to share with you.
The bottom line is that I sincerely hope nobody else thinks up another way I should solve this same problem.
But don't be surprised if I end up enhancing the bash script to allow you to have as the input image files that could then be converted to OCRed PDFs.
I'd like to thank everyone who helped me test and gave me ideas.
And boy, when I do this, I'm always afraid I'm going to forget anyone.
And if I did, it was not intentional.
I want to thank Ed Tobias, Stephen Goetz, Joe from from the Northwoods, Matt Clerker-Dorothy, and Mike Price for their testing and ideas, George from Tulsa for showing us OCR My PDF in the first place, and to David Roth who actually needed this done.
Though many of you would think that this was too nerdy, I had a lot of fun learning how to write the script, how to work with that pesky path thing, how to work in Keyboard Maestro and Automator, and even how to finally beat shortcuts into submission in the very end.

The World’s Most Expensive Sour Raisins – a Story of Dark Patterns

https://www.podfeet.com/blog/2023/12/sour-raisins-dark-patterns/


[28:11] Well, it's that time of the week again. It's time for something with Bart Bouchat's, but it's not security bits and it's not programming by stealth.
How are you doing today, Bart?
I'm going to ignore the pain in my leg and think from my waist up. I'm great.
Wonderful. Oh, no, no, no. Biking is hard.
Well, anyway, you're here to tell us a story of, I guess it's a cautionary tale.
Would you put it that way?
That sounds fair, yes.

[28:39] So I think we've titled it The World's Most Expensive Sour Raisins.
It will have a little subtitle to give a bit more meat to it.
But basically, you and I talk a lot about security.
And one of the things I tell you is that everyone falls for things.
It doesn't matter how much you know, you will eventually fall for them.
And one of the things we've mentioned a few times is something called dark patterns.
And this is like the, you know, studying the dark arts in Hogwarts.
Of a part of computer science I absolutely adore called Human-Computer Interaction, HCI. It was one of my favorite courses of my degree.
Because learning how to make computers not confuse a bejeebus set of people is really hard.
Making good interfaces is hard. Why am I a Mac lover? It's because Apple are good at HCI.

[29:26] And if you understand how to make computers easy for people, you can take that knowledge and twist it, and you can design interfaces that are really good at tricking people.
So you take everything you learn. So using those skills for evil.
Using those skills for evil. Yeah, and so we call a good idea a design pattern.
So you use, like, ideally speaking, you use existing design patterns because then you don't confuse people because it works like everything else works.
That's a design pattern.
Like the back arrow on an iPhone is always in the upper left.
Exactly, exactly. They're design patterns. And that we tend to have clickable things be raised, not lowered. The design pattern for lowered is you have done this already.
The design pattern for you can push this is I am sticking up.

[30:19] Oh, graphically making it look like it sticks up. That is a design pattern. Yeah. Yeah.
So, you know, and the name we've given the evil twin is dark pattern.
And they change all the time, of course, but their aim is to use science to engineer things so that humans are likely to do what you want, which is probably not in their interest. In fact, by definition, it's not in their interest. That's what makes it dark.
If you're trying to help the user, it's a pattern. If you're trying to defraud the user, it's a dark pattern.
And so I know about this. I studied it. I love it. It's one of my favorite parts of computer science. So you would imagine that I am immune to such things.
No, I am not. Because these are designed to trick humans.
And I am a human. So are you, and so is everyone. one.
So the best we can do is stack the odds in our favor by keeping ourselves aware of these things but we're all going to mess up sooner or later and when it happens rather than hiding away in shame I prefer to just say okay teachable moment I'm going to take it on the chin and I'm going to share.
Because that makes the probability of others falling for it a little bit lower.
So basically, I fell for a dark pattern. It cost me quite a lot of money, and it has something to do with sour raisins.

[31:40] Something else feels sour as well. It's not the raisins. So I guess it's a slight diversion.
One of the biggest things I've learned in my health journey over the last decade or so is it's not about not eating things. It's about portion size.
And actually this is a design pattern as well so if you want to do something it needs to be the default it needs to be the easiest possible thing to do the right thing so i buy snacks in one person one portion packages i don't buy a pack of biscuits i buy a bag of bags of little mini biscuits meant for babies well for kids all right i buy fun size treat size but they come in a portion which means i really know when you're done i know when i'm done i have i take a bag a little bag out of the big bag and then i have my portion and i just eat it and i do it without thinking and i go oh it's empty but at least there's no more there if there were more there i would not think right so i remember when they came up with personal sized uh microwave popcorn i always thought the original bags were that was personal size because that's how much that's how That's how much popcorn I eat.
Well, if you're going to spread out something, there's a lot worse than popcorn.
There's a lot worse than popcorn.

[32:59] I think my worst ever was watching a movie in the dark.
Dangerous. With a bucket of ice cream that was definitely not meant for one person.
I'm just engrossed in the movie, engrossed in the movie, and I heard thunk.
Oh, no. The bottom of the big giant pot of ice cream. It's like, I've just eaten a liter of ice cream.
Oh, my God. Have you ever heard of Father Roderick?
He's a podcaster, but around since the very early days, he's a Catholic priest and he does wonderful podcasting stuff.
But he was talking one time about how he said, you should never watch the Harry Potter movies.
And I thought, oh man, he's going to be all luxury and all this.
And he says, because last night I watched a marathon of them and I ate an entire family-sized bag of Dorito chips.

[33:52] Ooh, that's a lot of, ooh, that's a lot of corn.
Yeah, yeah. It's a lot of a lot. Anyway, it happens to all of us. Okay, so portion size.
Portion size. And one of my absolute favorite afternoon snacks is sour, or sun-made sour raisins from your part of the world.
I've never even heard of them. Well, I think they're from Georgia.
Like, say your part in the biggest sense. Sure. Your continent.

[34:18] So they're dried raisins, which have been dried.
They've been infused with a syrup of a flavor and then dried.
And so you can have them in watermelon-flavored raisins or strawberry-flavored raisins. They're my two favorites. Oh, wow.
And they come in a little bag.
And they're 60 calories for each little bag. and they're a perfect little portion for just snacking away at mid-afternoon when you're a little bit peckish.
And so I have gotten into the habit of having a little bag of sun-made sour raisins every day and I could buy them in Irish supermarkets and I was great.
And then a few, about two or three months ago, they started disappearing.
They went from one supermarket and then another supermarket and then they're only in one supermarket.
So I bought loads of them because they keep their raisins. They're in a little plastic bag.

[35:04] But then they just completely disappeared. and they never came back and my supply started to run out and I sort of assumed they'll come back into stock but they never came back and I started getting more and more desperate and I said well I'll buy it online this keeps I can buy it in bulk I'll buy a box of boxes of little bags, fine you know buy it in bulk that way the shipping won't be twice the price of the raisins, and I googled and I searched everywhere that's reputable that I've bought stuff before and And nobody sold Sunmade Sour Raisins. They were all out of stock, out of stock, out of stock.
But every search engine kept sending me to one site.
I don't know what it was, but something about the site didn't look right to me.
And I didn't buy it, and I didn't buy it, and I didn't buy it.
And once a week, every week, I had a little reminder on my phone, see if you can find some sour raisins, and I never found them.
And so eventually, in desperation, I went, oh, I guess, I guess this has to be the site.

[36:01] And they did have a .ie domain name which initially made me think ooh they're Irish and then I noticed they have a .be and a .co.uk and a .com and a .de and a .f4 they basically bought one everywhere so they're pretending to be everywhere and I later found out I know exactly where they are they're in the United Arab Emirates, well outside the European Union and all of my consumer rights uh oh yeah that's not a good start first little takeaway here but anyway Anyway, I, you know, they had what I wanted. They even had a choice of flavors.
I, you know, I could buy a box of 10 boxes and it wasn't too expensive. Okay, fine.
I was squeezing this in on my lunchtime walk. I was on my phone, small little screen, bit of a rush.
I had a meeting straight after lunch. I was a bit cranky. Fine, bye.
Check out. Okay, take, okay. Oh, shipping. Two buttons. Giant big button with the word free.

[36:58] Actually, that was the second button. The first button was a giant big button with a very big number in it, in euro.
And it was twice the price of the raisins for the shipping.
And next to it was a giant big button labeled free with no price or anything on it.
And some small text underneath that was very small and a little bit gray.
And I was in a rush and I went, free, okay, free, click.
And I think I thought it was slower or something, I presume.
Or maybe I didn't think anything at all.
Either way, I clicked on the giant big free button. I didn't read the small print.
And my raisins arrived. I paid with Apple Pay. And as soon as I saw the Apple Pay, I went, oh, that's grand then.
No need to worry about anything here. I've paid with Apple Pay. This will be fine.
I can't steal my credit card and sell it to other people. Which is true.
But that doesn't mean I didn't have a problem.
So I gave them my payment details. And I face ID'd to prove it really was me.

[37:53] So I got my raisins. They took about a week to arrive.
And I was initially quite happy because they're very tasty and they were perfect and I still have quite a few left because I bought a lot of them and then 30 days after I placed the order I noticed well 30 days and six hours I noticed sitting in my inbox was an email saying if you don't cancel your free trial within 24 hours of receiving this email we will bill you for the first year at 189 euro.
189 euro? For what? For what? For one shipment? For a pro membership.
No, for free shipping for a year. Basically the equivalent of Amazon Prime from this other site that is most certainly not Amazon.
They call it a pro membership.
That's why I got the free shipping. Because I took a one month trial on their pro membership. That's what the small print said. That I didn't read. Oh no.
And it comes in increments not of a month, but of a year.

[38:55] So kidding yeah so i immediately opened up my banking app because it was 24 hours and six more hours it was about 30 hours and i opened up my banking app and lo and behold pending transactions there it was 189 euro so i was like oh but it's pending i'll ring my bank i will tell them it is fraud and uh the lady in the bank so actually pending just means that it's been approved and it just hasn't finished processing so it means it's work in progress not that it's not approved so actually the transaction has happened it just hasn't you know the money hasn't gone all the way from you to them but it has happened so we actually can't stop it i said but it's fraud and she went well i can see here that you bought something from them 30 days ago um did you give them your details like well yeah it says here you used apple pay and you used the biometric yeah so you gave this company your details and you bought a product and they ship you the product. Yeah, it's not fraud.

[39:56] But I didn't sign up to this. Well, you say you didn't sign up to this, but from Visa's point of view and from all of the credit card companies, because they all follow the same rules, it's those rules that give you that security standard that everyone has to abide by, those same rules.
But basically, from the point of view of the rules, if I gave my details and the vendor sent me the product, then if I demand my money back, I'm defrauding the vendor.
Then I am actually the source of the fraud.
Oh, wow. Whereas if someone had stolen my card and used it and it wasn't me, then it would be an instant refund because that's credit card fraud.
But if I give them the details, it's completely different. So then the only option is a, you can contest the charge is the term.
And to contest the charge, you need to provide proof that they didn't do what they said they would do and that you have raised your concerns with them and that they have refused to help you.
And if you have those two pieces of evidence, then Visa or MasterCard or whoever will consider reversing the charge.
So what are the two things you have to have?
Proof that they did something that was not, that they said they would do X, but they did Y.

[41:11] And that you have raised it with them and they have refused to refund you.
And have you raised it with them?
Well, yes. Yes, but I would at that stage, I started to go back to their website and take a close look at all that small print and stuff.
And as soon as I opened up a chat with their support people, I explained my situation.
And within far too little time for any human to type it, I got back five screenshots annotated and a giant big paragraph of pre-written text.
They obviously give to everyone because it's a dark pattern.
Lots of people fall for dark patterns. basically explaining how well actually if you looked here under that big button in the small print that says that you're agreeing to a one month trial it will automatically bill unless you cancel within 30 days and the period is one year and so this they had it banged to rights, technically speaking had I read all the small print it absolutely said that they would do what they did so there was no point in my even wasting my time going back to Visa because I failed on both counts Thanks.
So anyway, what's so sad about this is that your spidey sense was correct. It was, I know.
Now, I actually had, I had three chances not to fall for it.
So the first chance was the small print under the big free button.
So they offered me exactly what I wanted. And there was small print that I was too busy to read. And I was on a cramped phone and it was awkward.

[42:38] Well, if I had read, it would have said exactly what they were going to do.
So chance number one, when there's small print, read it.
Don't assume because you're Apple paying it that you're somehow magically safe.
You're absolutely positively not.
You are safe from them losing your card through incompetence or selling your card through crime.
But if you give them your details to enter a transaction with them, that is not credit card fraud.
And they didn't lie. And they didn't lie.
So read the small print is the first lesson. a few days after i bought the raisins and after they sent me the notification saying they had shipped them i got another email from them which i assumed was the typical post-purchase spam you get from every company you are silly enough to give your money to my inbox is full of stuff from, amazon who think well you bought one thing so you'd like the exact same thing again, or from 12 south because i love their docs and stuff and i bought a few but they seem to think I want to buy stuff off them every day.

[43:38] And Sonos, because I have a bunch of their speakers, they think I need more.
And Tefica, who make the lovely watch bands I adore, they just keep sending me emails too.
And unfortunately, they've convinced me to buy more watch bands, so they're going to keep sending me those forever. That kind of worked, actually. Oops.
You could unsubscribe from those. Those do stop. Yeah, from legit companies.
Yeah, so I got one from this crowd who sold me the Raisins, and I just filed it away under, oh yeah well now I'm going to be smelling by you forever, because by Spidey sense it good off I was expecting these people to hang on to me like a bad smell so you know yeah whatever but actually, what it actually said was welcome to our pro membership club you get the benefit of free shipping small print again small print in the bottom of the email if you do not unsubscribe by blah date we will bill you 189 euro.

[44:29] It was there. It was well hidden again. At this point, you might as well buy a lot more raisins from them.
Oh, well, that's the thing. Well, yes, because I then contacted their support and I went, I would like a refund.
Now, technically speaking, so she gave me back the whole big click, you know, bang, bang, bang. Okay, fine.
So, okay. So technically speaking, I entered into this contract. It has now been one day.
I would like to cancel the contract and like a refund pro rata.
Tata, I would like to have 364 days worth of a refund, please.
I can cancel your contract immediately. You will never be billed again.
Your membership will expire in 364 days.

[45:09] Can I get a refund for the outstanding? No, but I can cancel your membership immediately for you.
And you won't be billed again. That is good because you don't have to remember in 364 days to cancel it.
That's the way like the Apple subscriptions do it, right? If you sign up for a service on a free trial or something like that, the first thing you do is cancel it.
You still get the free trial length.
But that way you don't have to remember when to cancel it.
Yeah, so that is definitely something you should do. So yeah, no refund. You're right, I'm going to order a lot of raisins because I get free shipping for the year.
Free? No, not free. As much as you hate to give them money, you might as well at this point, right?
Right? Yeah. Yes. Well, yeah, right. They have it.
So they already have my money. I need to get some stuff out of them.
And actually they sell basically anything American you can't buy abroad.
So part of me is thinking I may want Twinkies. I don't think I do, but maybe I do. Maybe they're delicious. I don't know.
What I'm worried about is these are going to leave a sour taste in your mouth.
Oh, God, yeah. Get what I did there? Did you hear what I did?

[46:20] Actually, Reese's. Reese's do really good stuff. Well, I might buy a lot of Reese's. Maybe that's what I'll do. Chocolate doesn't always travel well.
Peanuts, though? Peanuts, but... Well, I mean, Reese's is mostly peanut, right?
I mean, what makes Reese's amazing is the peanut. The chocolate is American chocolate, so it's pretty ho-ho. But the peanut on the inside is...

[46:45] Anyway, so quite a few lessons to be learned out of all of this.
So first off, don't buy things when you're in a rush.
Because everything I needed to know was in front of my nose, I didn't see it. Because I was in a rush.
Probably don't buy things on screens that are too small to use comfortably.
Because a lot of people do that yeah i ended up sort of kind of doing it again when trying to get a higher car because i was again i i needed to get it done i didn't get defrauded or anything but it took me five or six goes to make the transaction work because there was so much scrolling involved they kept on missing the checkbox that says i agree to your terms and service because i couldn't see it it was lost in the scroll and it did that thing where when you click a button it auto scrolls and so i didn't know whether i was up or down i didn't know where I didn't know where I was anymore. The thing kept scrolling up and down.
And then it actually crashed and ended up having to do it on my computer later anyway.
And I ended up buying it from a different company for 50 euro less now that I think about it. So on the whole, that actually worked out quite well.

[47:49] So that's lesson number two. Lesson number three. If there is small print, thou shalt read it.
If it is there and they went to the bother of making it not big, they're hiding something. Read it.
That's an interesting thought yeah the other thing is if you get a follow-up email don't just assume it's spam at least give it a cursory read probably more than a cursory read if it contains small print see above statement about small print and yeah maybe the first follow-up email yeah or whether it says the word welcome it's probably a dangerous one actually you should You probably look at anything that says welcome. Welcome to one.

[48:31] Understand that Apple Pay does protect you from a specific set of really bad things that you really do want protection from, but it is not a magic wand.
If you enter into an Apple Pay transaction, it is no different to any other banking transaction.
You are giving them your details. It's not fraud.
You may dispute the claim if they end up, if you can prove they lied to you, but it's not credit card fraud. If they didn't steal your credit card number, you gave it to them.
So that is, I now understand way better. It's still good. And I'm still always going to use Apple Pay when I can.
But it's not quite as magical as I sort of hoped it was.
And in case anyone's confused, I was confused when Bart and I first talked about this.
This is, everything he's talking about is Apple Pay, not the Apple Card.
I don't think Apple Card would have saved you either. I don't think so because at the end of the day, they're backed by a bank who are all part of this, I wish the payment something or the payment card association or something.
PCI is the standard that they've invented for security. And those same people set all the rules and they're all the same.
Like whether it's a MasterCard or a Visa or whatever it is, all the same.

[49:43] And the last thing is just because a website has your country's top level domain.
Now, this isn't a big deal for you Americans because the whole world uses .com.
But a lot of us who don't live in America are used to having a warm fuzzy feeling when we see our own country in the top level domain because we think oh we're buying local yeah look a little deeper because this company had a dot ie well weren't Irish they weren't even vaguely Irish they weren't even European and in terms of your consumer rights I mean Ireland simply implements EU law so there was no difference between between an Irish company and a French company company.
English company is now different because they've sought it out from the EU and they don't like regulation anymore.
So I don't have the same rights to buy from the UK as I used to, which is important for me to remember.
But, you know, we Europeans are used to seeing a .fr or a .be or a .de and feeling all warm and fuzzy.
It doesn't really matter where the domain is. That's not where your legal rights come from. Your legal rights come from the country that that the corporation is registered in.
If it had been registered in Ireland, what process would you follow?
What would be different?

[50:50] So in the European Union, there are laws that outlaw dark patterns.
It would not be an open and shut case. It would not be a slam dunk.
But I could make the argument that this was an example of, and therefore it breached this law.
And I don't know if I'd win, But there will be a ground to have a go Yeah Yeah.

[51:16] Well, I'm sure sorry this happened to you, Bart. I definitely sympathize.
The only dark pattern I know I consistently fall for is there's been a couple of websites out there in the past that help you find applications to run.
I want to say Alternative 2 might be one of them, where people are looking for an alternative to an application on the Mac, but they're running on Windows.
So you can go there and you tell it, I want Windows and I want it to be free.
What are my alternatives that I can choose from? And there's almost always, I hate it if I, I hope I'm not accusing the wrong company, but it's one of these.
And it has a big button that says Go in blue after you do the search.
And that Go is to an ad. ad it's definitely not to the thing that you're trying to do i think it was download.com used to have giant big green buttons in their ads that's it it's download.com yeah yeah yeah and you went to a place called download.com and there's a giant big green button to download on you that's not it that's the ad that that's what they're tricking you yeah and it works every time yeah oh yeah fell for that so many times yeah yeah well i appreciate you uh you making it a lesson for for the rest of us to pay better attention and, and maybe you kept one or two of us from falling for it.
But I think it is a good lesson to say that you probably will fall for something and don't shame yourself.
Tell other people what happened and hopefully it won't happen to them.

[52:46] Exactly. Yeah. You know, pay it forward. And if everyone else does it, then you might get the advice you need from someone else.
There you go. All right, Bart, I appreciate you coming on and telling us this story.
I don't, I don't know that you have an official tagline to say goodbye with, with, but goodbye. Yeah.
Happy purchasing. I don't know.

[53:03] Well, that's going to wind us up for this week and for this year.
Did you know you can email me at allison at podfeet.com anytime you like?
If you have a question or a suggestion, just send it on over.
You can follow me on Mastodon at podfeet at chaos.social.
Remember, everything good starts with podfeet.com. If you want to join in the conversation, you can join our Slack community at podfeet.com slash Slack, or you you can talk to me and all of the other lovely Nocella Castaways.
You can support the show at podfee.com slash Patreon or with a one-time donation at podfee.com slash PayPal.
And if you want to join in the fun of the live show, you're going to have to wait until January 14th when you can head on over to podfee.com slash live on Sunday nights at 5 p.m. Pacific time and join the friendly and enthusiastic Nocella Castaways.

[53:47] Music.