Sunday, December 4, 2022

#1 2021-07-07 03:49:21 am

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

Would it be possible to find any bundle from preferences plist

The approach of this script is to reveal the main bundle, to get dictionary, path and name.
From  bundle id from preferences plist from local domain. The workflow is for the moment
to take Finder selection and run the script.

It looks to work for preferences of application bundle.

My question would it be possible to reveal any bundle from a preferences plist that is not a
application bundle ??, or find the parent or owner of the preferences plist...

Here is the script.

Applescript:

use framework "Foundation"
use scripting additions

property appPath : missing value

tell application "Finder" to set theSelectedName to name of (item 1 of (get selection)) as text
set theSelectedName to text 1 thru -7 of theSelectedName
set theBundleID to theSelectedName
try
   set appDict to (current application's NSBundle's bundleWithIdentifier:theBundleID)'s infoDictionary()
   
   set appPath to (current application's NSBundle's bundleWithIdentifier:theBundleID)'s bundlePath()
   
   set appName to (current application's NSBundle's bundleWithIdentifier:theBundleID)'s objectForInfoDictionaryKey:(current application's kCFBundleExecutableKey)
   
   do shell script "open -R " & quoted form of (appPath as string)
   return {dictionary:appDict as record, path:appPath as string, name:appName as string}
end try


Node-RED makes it easy to automate IoT

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)