Suddenly Applescripts don't have permission
After updating to Sequoia 15.3 suddenly Applescript menu doesn't have permission to open files:
How can I stop this madness?
After updating to Sequoia 15.3 suddenly Applescript menu doesn't have permission to open files:
How can I stop this madness?
Thanks, this actually solved the same issue I was having. But I think you could eliminate the Finder line. Here's what I have (that is currently working):
set theFile to (path to documents folder) & "mtgsoon.rtf"
tell application "TextEdit" to open file theFile
Have you checked the Security System Settings to make sure the Privacy & Security System Settings are still active for all the components related to your AppleScript, Python/Python script, and others. And no, it is not easy to tell what item belongs to which app in those Privacy & Security System Settings.
The path to sites folder is the problem that needs to be investigated. Suggest inserting a display dialog command just prior to "tell application" to determine what it is.
set thePath to (path to sites folder) as string
display dialog (thePath) buttons "ok"
Something like that.
I assume not because
tell application "Finder" to open ((path to sites folder) as string)
still opens the folder.
It's not a terrible problem, I was able to fix it by saying (the less elegant):
tell application "Finder" to ((path to sites folder) as string) & "Add a dream.py" as alias
tell application "CotEditor" to open result
It's just that suddenly as of 15.3 Finder is unable to decide which app should open *.py files. Bummer because I have a lot of these scripts in the Applescript menu. And I repeat, Finder still knows when the script is run inside Script Editor.
Pardon if this is redundant.
Locate any one of these Sites folder's Python files and perform a Get Info on it so you can set its default open with CotEditor. Follow through with the Change All… button. Quit Script Editor and then try AppleScript again to see if CotEditor now opens the result correctly.
Did you update the version of CotEditor, or has the developer dropped AppleScript dictionary support in it?
Substituting "Sublime Text" for your "CotEditor" and an HTML file from my Sites folder works as expected in Sequoia v15.3 when used interactively in Script Editor. I don't run AppleScripts from my menu bar.
use scripting additions
tell application "Finder" to ((path to sites folder) as string) & "dlx.html" as alias
tell application "Sublime Text" to open result
Hi Gnarlodious
I noticed one of my AppleScripts stopped working under Sequoia, though it may have been Sonoma, which required I change something about it. Off the top of my head I don't recall precisely what it was though, but I believe it had something to do with the location of one of its files.
You probably aren't going to get much help here unless you were to post the affected AppleScript, or at least a significant portion of it. Can you do that?
Scripting including support for Python has become somewhat rudderless after Sal Soghoian left Apple a decade or so ago. I surmise he saw the writing on the wall which said "if iOS doesn't do it, neither will macOS" and that was that.
Yes, all those settings are still active. However it seems like there are a lot more options in that panel compared to what I remember.
The offending script looks like
tell application "Finder" to open ((path to sites folder) as string) & "Add a dream.py" as alias
However the script runs normally inside Script Editor. So apparently Finder is either "null" or can't decide from Finder which application defaults for *.py files.
Gnarlodious wrote:
After updating to Sequoia 15.3 suddenly Applescript menu doesn't have permission to open files:
https://discussions.apple.com/content/attachment/f2184ec1-192f-4076-88ad-10610507a47c
How can I stop this madness?
what changed?
Sequoia 15.3 from what previously could be an important piece of background information here ...(?)
Python from where, how...is HomeBrew involved here(?)
It's just that suddenly as of 15.3 Finder is unable to decide which app should open *.py files.
It would appear so. Given that limitation I think your workaround is a good one. Also see if VikingOSX's suggestion works in lieu of it.
I guess I would assume that application “(null)” means Applescript Menu (see my original screenshot). Trouble is, every time some app wanted to open a file and needed permission it would appear in the Privacy and Security prefpanel and be easy to add. But this is the first time I've seen this happen.
Suddenly Applescripts don't have permission