Open with Finder AppleScript Bug in macOS 12.3

Yeah, this hit me today. As a heavy Finder/KM user, I use these open Finder files with application macros a lot. At first I thought Photoshop had broken, which is certainly the most likely issue. I'm going to hit these keystrokes and have the files not open countless times before there's a fix, and 'til then I'll try to just control click or drag a Finder file to the dock.

2 Likes

This is a bad idea - applications should not be opened with the ā€œDefault Applicationā€. The ā€œDefault Applicationā€ for ā€œ.appā€ can be almost anything, it could be an archiver, it could be an app cleaner, it could be anything at all. The fact that it is working for you currently is just luck.

3 Likes

It appears there is a bug in macOS 12.3 Finder such that asking it to open documents via AppleScript is broken in a variety of ways.

The best apparent solution so far seems to be:

For launching applications, you should probably always be using the Activate a Specific Application action to launch it.

4 Likes

Noted. And I see the warning triangle when I have changed my Action from "with Finder" to "Default Application". And this warning is similar to what you have just written.

In my case the Actions that were working before and are now broken by the macOS12.3 bug all look like this:

The Dictionary entry is a path to an Application (it could have been a Variable). Either way, it varies.

What I like about this use of "open with Finder" Action is that it restores the Application Window even if its Window has been minimized.

I think I will just have to wait until Apple fix the bug. As it affects AppleScript it's probably going to be noted by lots of people. I have sent a bug report in to Apple and hopefully others will too. Feedback - macOS - Apple

The irony is that I was waiting for the release of 12.3 to fix another AppleScript bug (to do with making a Contact using AppleScript) and Apple actually fixed that but now this other thing is brokenā€¦ :worried:

1 Like

The good news is that this seems to be getting some reporting outside of this Forum so, bodes well for the macOS12.3 AppleScript bug to be noticed and fixed:

From this report, a little way down on the page: https://www.kiratas.com/problems-with-macos-12-3-reports-of-broken-macbooks-broken-scripts/

Problems also with Safari 15.4 and AppleScript

macOS 12.3 also brings new bugs with AppleScript and apparently prevents files from being opened ā€“ a basic function. This fails with error -1703, as reported by the developer of the keyboard shortcut tool Keyboard Maestrowhich is directly affected.

2 Likes

I'm using macOS Monterey 12.3 on a 24" M1 iMac.
I'm not sure if I'm following this thread, but FWIW this works whether TextEdit is open or not.
I have the following macro that's triggered by a kmtrigger file (so I can have it in the Dock).

Open ā€œ/Users/Steve/Documents/Scratch Pad/Scratch Pad.rtfdā€
with TextEdit
Execute Macro ā€œSet Window Position Scratch Pad.rtfdā€ Asynchronously
[merely moves and sizes the window from the standard upper left to lower right*]

BTW, this window move is much faster on M1 than on my 2014 27" iMac (RIP).

The bug that I described for scripts involves Finder, Keyboard Maestro, and other possible "helper" apps. I think it's a lower level bug than what your method employs. For one thing, ".rtfd" documents are actually folders on the basic level. If you want to exemplify the bug on your system, you could remove all elements other than rich text from your "Scratch Pad.rtfd" document and save it as "Scratch Pad.rtf", then run the following AppleScript in Script Editor.app.

set rtfile to alias ((path to documents folder as text) & "Scratch Pad.rtf")
tell application "Finder"
	activate
	open rtfile
end tell

If you ensure that TextEdit is not running when you first run the above AppleScript, you'll observe that TextEdit launches, but doesn't open your document. If you run it again without quitting TextEdit, then you'll see the -1703 error.

There are workarounds, but the bug signifies an unwelcome change to the Mac system for many of us, and we'd like to see it fixed. But chances for that are quite unpredictable, I'd say. I've frozen one static backup method for my system, but I'll probably have to abandon that strategy eventually.

1 Like

Not sure what else the Monterey 12.3.1 update may help or harm, but it does appear to fix this. Thanks, Apple.

6 Likes

I will just confirm it is also fixed after I updated to 12.3.1.

4 Likes