My applet has code with uses curl to download a web page, convert the result into text then parses its content. The code has worked for years. The particular code at issue looks like this:
[format]set YTDL_site_URL to “https://github.com/yt-dlp/yt-dlp/releases”
set YTDL_releases_page to do shell script "curl " & YTDL_site_URL & " | textutil -stdin -stdout -format html -convert txt -encoding UTF-8[/format]
But, one of my users get nothing back. When testing the curl and the conversion in Terminal the user gets this:
[format]~ % curl “https://github.com/yt-dlp/yt-dlp/releases” | textutil -stdin -stdout -format html -convert txt -encoding UTF-8
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 365k 0 365k 0 0 2321k 0 --:–:-- --:–:-- --:–:-- 2419k
Error reading stdin. Couldn’t communicate with a helper application.[/format]
I have tested some ideas such as turning off various permissions but nothing I do on my Mac replicates the error.
I’m at a loss. It seems that the “curl” is working for my user (the correct amount of data is downloaded) but something is preventing stdin feeding into “textutil”. But, maybe the error is related to something else entirely.
Both the user and I are on macOS 13.0.
Any help much appreciated.
Why do you have the ‘[url]’ and ‘[/url]’ in your string. (had a tough time to get the square brackets to show)
I’ve never used that in any of my curl commands
set YTDL_site_URL to "https://github.com/yt-dlp/yt-dlp/releases"
set YTDL_releases_page to do shell script "curl " & YTDL_site_URL & " | textutil -stdin -stdout -format html -convert txt -encoding UTF-8"
Also more code from your script where the problem arises would be useful
I don’t. They are put there by MacScripter when using the “Format” or “Quote” functions. I spent some time trying to stop that. Perhaps I should have used the “Applescript” function but, it was such a small amount of code.
Difficult to know how much to show - I have over 5,000 lines in 5 script files. I know it’s close to being silly so I’m working on redeveloping in SwiftUI.
Anyway, the important point is that my user could not run the simple Terminal command. They got the “Error reading stdin” response. This morning they let me know that they are running macOS Ventura on 2013 MBP with the opencore legacy patcher. I said they should ask the OCLP experts for help. I’ve also got them to remove and re-add Full Disk Access permissions, in case the bug is relevant. Didn’t solve the problem. Poor user has reinstalled Ventura without luck and is working on installing Catalina on an external drive. In the meantime, I’m working up a workaround in my code.