script no longer quitting all open apps under 10.15

Thank you, Yvan, for testing and your amendment. I see, it works as expected.

Thank’s.

At last, I found the clean way to get the localizedName of the current application.

use AppleScript version "2.5" -- macOS 10.11 or later
use framework "Foundation"
use framework "AppKit"
use scripting additions

set curName to current application's NSRunningApplication's currentApplication()'s localizedName() as string

set theApps to current application's NSWorkspace's sharedWorkspace()'s runningApplications()
set thePred to current application's NSPredicate's predicateWithFormat:"activationPolicy == 0 AND NOT (localizedName IN %@)" argumentArray:{{"Finder", curName}} -- edit to suit
set theApps to theApps's filteredArrayUsingPredicate:thePred

repeat with anApp in theApps
	--anApp's terminate()
	log (localizedName() of anApp) as string -- EDITED according to Shane Stanley's comment
end repeat

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) samedi 25 avril 2020 20:47:09

It certainly should keep the current application running – but that may not be Script Editor. And I suppose the name of Finder could be localized in some locales. So:

use AppleScript version "2.5" -- macOS 10.11 or later
use framework "Foundation"
use framework "AppKit"
use scripting additions

set theFinder to (current application's NSRunningApplication's runningApplicationsWithBundleIdentifier:"com.apple.finder")'s firstObject()
set currApp to current application's NSRunningApplication's currentApplication()
set theApps to current application's NSWorkspace's sharedWorkspace()'s runningApplications()
set thePred to current application's NSPredicate's predicateWithFormat:"activationPolicy == 0 AND NOT (SELF IN %@)" argumentArray:{{theFinder, currApp}}
set theApps to theApps's filteredArrayUsingPredicate:thePred
repeat with anApp in theApps
	anApp's terminate()
end repeat

It’s not a need – more a convenience, in terms of avoiding repeated “current application’s”.

It’s generally safer to treat ASObjC properties as methods, so better to use localizedName(), with the parentheses.It doesn’t matter in the code you posted, but it can be a trap, so it’s a good habit.

Curiously, there are still some processes where System Events returns something different. AdobeAcrobat vs Acrobat Pro DC is one example. It looks like System Events uses the name of the executable in the app’s bundle.

It’s KniazidisR which asked for a code protecting the current application.
So I posted a code responding to its requirements.

For the Finder, you are right.
I missed that here is one language for which Finder is not spelled “Finder” but “访达”

----------------------------------------------------------------
use AppleScript version "2.5"
use framework "Foundation"
use scripting additions

-- Build an array of the localized names of the application Finder
-- Some languages are defined twice because they aren't named the same according to the running OS
-- Yvan KOENIG (VALLAURIS, France) dimanche 29 mars 2020  17:42:48
----------------------------------------------------------------

property |⌘| : a reference to current application

set theLanguages to paragraphs of "ar
ca
cs
da
de
el
en_AU
en_GB
en
es_419
es
fi
fr_CA
fr
he
hi
hr
hu
id
it
ja
ko
ms
nl
no
pl
pt_PT
pt
ro
ru
sk
sv
th
tr
uk
vi
zh_CN
zh_HK
zh_TW
Dutch
English
French
German
Italian
Japanese
Spanish"

set root to (path to application "Finder" as text) & "Contents:Resources:"
--set root to "resources YK:resources trois:Catalina:System:Library:CoreServices:Finder.app:" & "Contents:Resources:"
set fullTable to "InfoPlist.strings"

set allLocales to {"language" & tab & "CFBundleDisplayName" & tab & "CFBundleName"}
-- Now extract the values for every language available
repeat with usedLanguage in theLanguages
	set anURL to (|⌘|'s NSURL's fileURLWithPath:(POSIX path of (root & usedLanguage & ".lproj:" & fullTable)))
	set theDict to (|⌘|'s NSDictionary's dictionaryWithContentsOfURL:anURL)
	if theDict is not missing value then
		set val1 to (theDict's valueForKey:"CFBundleDisplayName")
		set val2 to (theDict's valueForKey:"CFBundleName")
	else
		set {val1, val2} to {"??", "??"}
	end if
	set end of allLocales to (usedLanguage as string) & tab & val1 & tab & val2
end repeat

set theData to my concatlist:allLocales usingString:linefeed
-- save data to new file
set reportName to "Finder local name.txt"
set hfsPath to (path to desktop as text) & reportName
set targetFile to hfsPath as «class furl»
(theData's writeToURL:targetFile atomically:true encoding:(|⌘|'s NSUTF8StringEncoding) |error|:(missing value))

tell application "TextEdit"
	activate
	if exists window reportName then close window reportName
	open targetFile
end tell

#=====

on concatlist:theList usingString:d1
	set anArray to current application's NSArray's arrayWithArray:theList
	return (anArray's componentsJoinedByString:d1) -- as text
end concatlist:usingString:

#=====

Here without my special path I get:
language CFBundleDisplayName CFBundleName
ar Finder Finder
ca Finder Finder
cs Finder Finder
da Finder Finder
de ?? ??
el Finder Finder
en_AU ?? ??
en_GB ?? ??
en ?? ??
es_419 Finder Finder
es ?? ??
fi Finder Finder
fr_CA ?? ??
fr ?? ??
he Finder Finder
hi Finder Finder
hr Finder Finder
hu Finder Finder
id Finder Finder
it ?? ??
ja ?? ??
ko Finder Finder
ms Finder Finder
nl ?? ??
no Finder Finder
pl Finder Finder
pt_PT Finder Finder
pt Finder Finder
ro Finder Finder
ru Finder Finder
sk Finder Finder
sv Finder Finder
th Finder Finder
tr Finder Finder
uk Finder Finder
vi Finder Finder
zh_CN 访达 访达
zh_HK ?? ??
zh_TW Finder Finder
Dutch Finder Finder
English Finder Finder
French Finder Finder
German Finder Finder
Italian Finder Finder
Japanese Finder Finder
Spanish Finder Finder

because several lprojs are missing (or named differently) in High Sierra.
In Mojave or Catalina, the double question marks would be replaced by “Finder” and the late seven descriptors would be ?? ??.

No, in message #13, you may see that I was forced to use the properties and this is why I was puzzled.
I don’t understand why it behaved this way because, as I wrote in an other message, after a copy/paste process it was no longer required.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche 26 avril 2020 12:07:18

Running under an older version of the OS, with Satimage scripting addition installed?

I run 10.13.6 but Satimage isn’t available.
What is really puzzling is that after a simple copy/paste in a blank script I got a script were the properties weren’t required.
At least, now I know what to do if the oddity strikes again but I would be more satisfied if I had a valid explanation for this behavior.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche 26 avril 2020 14:44:47