Tuesday, May 11, 2021

#1 2021-01-18 03:06:50 am

Fredrik71
Member
Registered: 2019-10-23
Posts: 707

Scriptable key from runningApplicaions

Example of a script to return scriptable key from runningApplicaions

Applescript:

use framework "Foundation"
use framework "AppKit"
use scripting additions

set workspace to (current application's NSWorkspace's sharedWorkspace())'s runningApplications()

repeat with anApp in workspace
   set {theResult, theKey, theError} to ((anApp's bundleURL())'s getResourceValue:(reference) forKey:(current application's NSURLApplicationIsScriptableKey) |error|:(reference))
   if theResult then
       set theString to (anApp's localizedName() as text) & ", " & (theKey as string) & linefeed
       log theString
   end if
end repeat


if you are the expert, who will you call if its not your imagination.

Online

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)