pluginkit

[pluginkit]Finder機能拡張 バージョン入りのIDの取得


【スクリプトエディタで開く】 |

pluginkitのIDの取得.scpt
ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003(*
004プラグインキットのバンドルIDから
005バージョン入りのIDを取得します
006
007v1初回作成
008v1.1 +の処理を追加
009com.cocolog-nifty.quicktimer.icefloe *)
010----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
011use AppleScript version "2.8"
012use framework "Foundation"
013use framework "UniformTypeIdentifiers"
014use framework "AppKit"
015use scripting additions
016
017property refMe : a reference to current application
018
019#取得したいID
020set strBundleID to ("com.microsoft.OneDrive.FileProvider") as text
021
022set refResponse to doZshTaskStdOUT("/usr/bin/pluginkit -m | grep \"" & strBundleID & "\"")
023if refResponse is false then
024   return "コマンド失敗"
025else
026   set ocidPathToMeStr to refMe's NSString's stringWithString:(refResponse)
027   set ocidPathToMeStr to (ocidPathToMeStr's stringByReplacingOccurrencesOfString:("\r") withString:(""))
028   set ocidPathToMeStr to (ocidPathToMeStr's stringByReplacingOccurrencesOfString:("\n") withString:(""))
029   set ocidPathToMeStr to (ocidPathToMeStr's stringByReplacingOccurrencesOfString:("\t") withString:(""))
030   set ocidPathToMeStr to (ocidPathToMeStr's stringByReplacingOccurrencesOfString:(" ") withString:(""))
031   #追加
032   set ocidPathToMeStr to (ocidPathToMeStr's stringByReplacingOccurrencesOfString:("+") withString:(""))
033   log ocidPathToMeStr as text
034end if
035
036###################################
037# ZSH 実行
038###################################
039to doZshTaskStdOUT(argCommandText)
040   set strCommandText to argCommandText as text
041   set ocidCommandText to refMe's NSString's stringWithString:(strCommandText)
042   set ocidTermTask to refMe's NSTask's alloc()'s init()
043   ocidTermTask's setLaunchPath:"/bin/zsh"
044   ocidTermTask's setArguments:({"-c", ocidCommandText})
045   #標準出力
046   set ocidOutPut to refMe's NSPipe's pipe()
047   ocidTermTask's setStandardOutput:(ocidOutPut)
048   #エラー出力
049   set ocidError to refMe's NSPipe's pipe()
050   ocidTermTask's setStandardError:(ocidError)
051   set listResults to ocidTermTask's launchAndReturnError:(reference)
052   if (item 1 of listResults) is true then
053      log "正常終了"
054      set ocidOutPutData to ocidOutPut's fileHandleForReading()
055      set listResponse to ocidOutPutData's readDataToEndOfFileAndReturnError:(reference)
056      set ocidStdOut to (item 1 of listResponse)
057      set ocidStdOut to refMe's NSString's alloc()'s initWithData:(ocidStdOut) encoding:(refMe's NSUTF8StringEncoding)
058      return (ocidStdOut as text)
059   else
060      try
061         set strResponse to (do shell script strCommandText) as text
062      on error
063         log " Zshでエラー"
064         return false
065      end try
066   end if
067   return true
068end doZshTaskStdOUT
AppleScriptで生成しました

【スクリプトエディタで開く】 |

pluginkitのIDの取得.scpt
ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003(*
004プラグインキットのバンドルIDから
005バージョン入りのIDを取得します
006
007com.cocolog-nifty.quicktimer.icefloe *)
008----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
009use AppleScript version "2.8"
010use framework "Foundation"
011use framework "UniformTypeIdentifiers"
012use framework "AppKit"
013use scripting additions
014
015property refMe : a reference to current application
016
017#取得したいID
018set strBundleID to ("com.microsoft.OneDrive.FileProvider") as text
019
020set refResponse to doZshTask("/usr/bin/pluginkit -m | grep \"" & strBundleID & "\"")
021if refResponse is false then
022   return "コマンド失敗"
023else
024   set ocidPathToMeStr to refMe's NSString's stringWithString:(refResponse)
025   set ocidPathToMeStr to (ocidPathToMeStr's stringByReplacingOccurrencesOfString:("\r") withString:(""))
026   set ocidPathToMeStr to (ocidPathToMeStr's stringByReplacingOccurrencesOfString:("\n") withString:(""))
027   set ocidPathToMeStr to (ocidPathToMeStr's stringByReplacingOccurrencesOfString:("\t") withString:(""))
028   set ocidPathToMeStr to (ocidPathToMeStr's stringByReplacingOccurrencesOfString:(" ") withString:(""))
029   log ocidPathToMeStr as text
030end if
031
032###################################
033# ZSH 実行
034###################################
035to doZshTask(argCommandText)
036   set strCommandText to argCommandText as text
037   set ocidCommandText to refMe's NSString's stringWithString:(strCommandText)
038   set ocidTermTask to refMe's NSTask's alloc()'s init()
039   ocidTermTask's setLaunchPath:"/bin/zsh"
040   ocidTermTask's setArguments:({"-c", ocidCommandText})
041   #標準出力
042   set ocidOutPut to refMe's NSPipe's pipe()
043   ocidTermTask's setStandardOutput:(ocidOutPut)
044   #エラー出力
045   set ocidError to refMe's NSPipe's pipe()
046   ocidTermTask's setStandardError:(ocidError)
047   set listResults to ocidTermTask's launchAndReturnError:(reference)
048   if (item 1 of listResults) is true then
049      log "正常終了"
050      set ocidOutPutData to ocidOutPut's fileHandleForReading()
051      set listResponse to ocidOutPutData's readDataToEndOfFileAndReturnError:(reference)
052      set ocidStdOut to (item 1 of listResponse)
053      set ocidStdOut to refMe's NSString's alloc()'s initWithData:(ocidStdOut) encoding:(refMe's NSUTF8StringEncoding)
054      return (ocidStdOut as text)
055   else
056      try
057         set strResponse to (do shell script strCommandText) as text
058      on error
059         log " Zshでエラー"
060         return false
061      end try
062   end if
063   return true
064end doZshTask
AppleScriptで生成しました

| | コメント (0)

[OneDrive]OneDrive をリセットできませんでした

[OneDrive]OneDriveの初期化(ユーザー設定も削除する)

[OneDrive]OneDriveの初期化(ユーザー設定は残す)


エラーメッセージ
OneDrive をリセットできませんでした
システム コンポーネントにより OneDrive の起動が妨げられています。Mac を再起動して、もう一度やり直してください。



OneDrive.appのプラグイン
OneDrive File Provider.appex
FinderSync.appexのどちらかが何らかの理由で動作不良になっている場合の例
あくまでも例です。他の原因もあります。十分に検討してから対応開始してください


事前準備
OneDriveフォルダ内を全部バックアップ
-->WEB
1:アカウントの切断(OneDrive>>基本設定>>アカウント)
-->アプリも終了
2:機能拡張切断
/usr/bin/pluginkit -r "/Applications/OneDrive.app/Contents/PlugIns/FinderSync.appex"
/usr/bin/pluginkit -r "/Applications/OneDrive.app/Contents/PlugIns/OneDrive File Provider.appex"
3:アプリケーション削除
/Applications/OneDrive.app ゴミ箱へ
4:設定削除
$HOME/Library/Group Containers/UBF8T346G9.OneDriveStandaloneSuite
$HOME/Library/Group Containers/UBF8T346G9.OfficeOneDriveSyncIntegration
留意
$HOME/Library/Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex
実体があるようで、これは実体ではない取っておいても無駄
事前準備でのバックアップは必須
5:ゴミ箱空に(しなくてもOK)
再起動後にインストール再設定で復旧する

|

[mobileconfig]com.apple.NSExtension

AllowedExtensions

DeniedExtensions の違いのみ

ダウンロード - com.apple.nsextension.zip



<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>


    <key>PayloadContent</key>

    <array>

        <dict>


            <key>AllowedExtensions</key>

            <array>

                <string>com.box.desktop.findersyncext</string>

                <string>com.box.desktop.boxfileprovider</string>

                <string>com.adobe.accmac.ACCFinderSync</string>

                

            </array>


            <key>DeniedExtensions</key>

            <array>

                <string>jp.naver.line.mac.ShareExt</string>

            </array>



            <key>PayloadDisplayName</key>

            <string>com.apple.NSExtension</string>

            <key>PayloadIdentifier</key>

            <string>com.apple.NSExtension.37E39FD3-C74C-45CE-B75E-AB09D240957A</string>

            <key>PayloadType</key>

            <string>com.apple.NSExtension</string>

            <key>PayloadUUID</key>

            <string>F84A1D78-7E56-4B7E-850F-10444DD28834</string>

            <key>PayloadVersion</key>

            <integer>1</integer>

        </dict>

    </array>

    <key>PayloadDescription</key>

    <string>com.apple.NSExtension</string>

    <key>PayloadDisplayName</key>

    <string>com.apple.NSExtension</string>

        <key>ConsentText</key>

    <dict>

        <key>default</key>

        <string>com.apple.NSExtension</string>

    </dict>

    <key>PayloadIdentifier</key>

    <string>61AD84B8-19E9-4DD0-B982-87FD6C24B40C</string>

    <key>PayloadOrganization</key>

    <string>com.apple.NSExtension</string>

    <key>PayloadScope</key>

    <string>System</string>

    <key>PayloadType</key>

    <string>Configuration</string>

    <key>PayloadUUID</key>

    <string>E1539E71-C020-40E0-B1D8-64B8278B3C7C</string>

    <key>PayloadVersion</key>

    <integer>1</integer>

    <key>TargetDeviceType</key>

    <integer>5</integer>

</dict>

</plist>


|

[appex]プラグインの情報を取得する

[pluginkit]Finder機能拡張関連
https://quicktimer.cocolog-nifty.com/icefloe/2022/04/post-c04772.html
必要な項目を取得するだけ



#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

####選択ダイアログ
set aliasFile to (choose file with prompt "アプリケーションを選んでください" default location (path to applications folder from local domain) of type {"com.apple.application-bundle"} without showing package contents, multiple selections allowed and invisibles)


set aliasFilePath to aliasFile as alias

set strFilePath to POSIX path of aliasFilePath as text

set strPluginDir to "Contents/PlugIns/"

set strPluginPath to ("" & strFilePath & strPluginDir & "") as text

set strCommandText to ("ls -1 \"" & strPluginPath & "\"") as text
try
set strResponcet to do shell script strCommandText
on error
return "プラグインはありません"
end try
set AppleScript's text item delimiters to "\r"
set listAppex to every text item of strResponcet

set numCntAppex to count of listAppex

set strPromptText to ("" & numCntAppex & "つのAppexが見つかりました") as text

try
set objResponse to (choose from list listAppex with title "選んでください" with prompt strPromptText default items (item 1 of listAppex) OK button name "OK" cancel button name "キャンセル" without multiple selections allowed and empty selection allowed)
on error
log "エラーしました"
return
end try
if objResponse is false then
return
end if

set theResponse to (objResponse) as text

set strAppexPath to ("" & strPluginPath & theResponse & "") as text

set strInfoPath to ("" & strAppexPath & "/Contents/Info.plist") as text

set strCommandText to ("defaults read \"" & strInfoPath & "\" CFBundleIdentifier") as text
set strBundleIdentifier to do shell script strCommandText


set strPromptText to ("/usr/bin/pluginkit\n" & strAppexPath & "\n" & strBundleIdentifier & "\n") as text

set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns" as alias
set theResponse to 2 as number
try
set objResponse to (display dialog ("/usr/bin/pluginkit -r \n/usr/bin/pluginkit -a \n/usr/bin/pluginkit -e ignore -i\n/usr/bin/pluginkit -e use -i ") with title "取得データ" default answer strPromptText buttons {"OK", "キャンセル"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 20 without hidden answer)
on error
log "エラーしました"
return
end try

|

[pluginkit]Finder機能拡張

/usr/bin/pluginkit
20220402172013_1280x588



一覧
/usr/bin/pluginkit -mA

sh-3.2$ 

sh-3.2$  /usr/bin/pluginkit -mA

+    com.skitch.skitch.SkitchMacPhotoEditing(2.9)

     com.apple.diagnosticextensions.osx.wifi(1.0)

     com.apple.TranslationUIServices.TranslationUIService(1.0)

+    com.apple.mobileslideshow.photospicker(1.0)

     com.apple.DiagnosticExtensions.sysdiagnose(1.0)

     com.apple.diagnosticextensions.osx.syslog(1.0)

     com.evernote.Evernote.shareext(10.34.4)

+    com.apple.VoiceMemos.SpotlightIndexExtension(2.3)




一覧:詳細
パスが出るの削除等する場合はこれ
/usr/bin/pluginkit -mAvvv

sh-3.2$ 

sh-3.2$ pluginkit -mAvvv

+    com.skitch.skitch.SkitchMacPhotoEditing(2.9)

            Path = /Applications/Skitch.app/Contents/PlugIns/SkitchMacPhotoEditing.appex

            UUID = CC648A9E-4689-48C3-B2E0-939AB4C58D80

      Timestamp = 2022-04-01 10:09:50 +0000

            SDK = com.apple.photo-editing

  Parent Bundle = /Applications/Skitch.app

    Display Name = Skitch Markup

      Short Name = SkitchMacPhotoEditing

    Parent Name = Skitch




削除
Finder機能拡張と写真編集等は別のappexファイルなので
全部削除するなら個別に削除
対象の『機能』が分からない場合は注意が必要
/usr/bin/pluginkit -r パス
Finder機能拡張

sh-3.2$ 

sh-3.2$ 

sh-3.2$  /usr/bin/pluginkit -r "/Applications/Skitch.app/Contents/PlugIns/SkitchMacAction.appex"

sh-3.2$ 

写真編集

sh-3.2$ 

sh-3.2$ 

sh-3.2$ /usr/bin/pluginkit -r "/Applications/Skitch.app/Contents/PlugIns/SkitchMacPhotoEditing.appex"

sh-3.2$ 



追加
/usr/bin/pluginkit -a

sh-3.2$ 

sh-3.2$ /usr/bin/pluginkit -a "/Applications/LINE.app/Contents/PlugIns/ShareExt.appex"

sh-3.2$ 



有効化
/usr/bin/pluginkit -e use -i com.microsoft.onenote.mac.shareextension

sh-3.2$ 

sh-3.2$ /usr/bin/pluginkit -e use -i com.microsoft.onenote.mac.shareextension

sh-3.2$ 



無効化
/usr/bin/pluginkit -e ignore -i com.microsoft.onenote.mac.shareextension

sh-3.2$ 

sh-3.2$ 

sh-3.2$ /usr/bin/pluginkit -e ignore -i com.microsoft.onenote.mac.shareextension

sh-3.2$ 

sh-3.2$ 


|

その他のカテゴリー

Accessibility Acrobat Acrobat 2020 Acrobat 2024 Acrobat AddOn Acrobat Annotation Acrobat AppleScript Acrobat ARMDC Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat GentechAI Acrobat JS Acrobat JS Word Search Acrobat Maintenance Acrobat Manifest Acrobat Menu Acrobat Merge Acrobat Open Acrobat PDFPage Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat Print Acrobat Python Acrobat Reader Acrobat Reader Localized Acrobat Reference Acrobat Registered Products Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat URL List Mac Acrobat URL List Windows Acrobat Watermark Acrobat Windows Acrobat Windows Reader Admin Admin Account Admin Apachectl Admin ConfigCode Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin NetWork Admin Permission Admin Pkg Admin Power Management Admin Printer Admin Printer Basic Admin Printer Custompapers Admin SetUp Admin SMB Admin softwareupdate Admin Support Admin System Information Admin TCC Admin Tools Admin Umask Admin Users Admin Volumes Admin XProtect Adobe Adobe AUSST Adobe Bridge Adobe Documents Adobe FDKO Adobe Fonts Adobe Reference Adobe RemoteUpdateManager Adobe Sap Code AppKit Apple AppleScript AppleScript Duplicate AppleScript entire contents AppleScript List AppleScript ObjC AppleScript Osax AppleScript PDF AppleScript Pictures AppleScript record AppleScript Video Applications AppStore Archive Archive Keka Attributes Automator BackUp Barcode Barcode Decode Barcode QR Bash Basic Basic Path Bluetooth BOX Browser Calendar CD/DVD Choose Chrome Chromedriver CIImage CityCode CloudStorage Color Color NSColor Color NSColorList com.apple.LaunchServices.OpenWith Console Contacts CotEditor CURL current application Date&Time delimiters Desktop Desktop Position Device Diff Disk do shell script Dock Dock Launchpad DropBox Droplet eMail Encode % Encode Decode Encode HTML Entity Encode UTF8 Error EXIFData exiftool ffmpeg File File Name Finder Finder Window Firefox Folder FolderAction Font List FontCollections Fonts Fonts Asset_Font Fonts ATS Fonts Emoji Fonts Maintenance Fonts Morisawa Fonts Python Fonts Variable Foxit GIF github Guide HTML Icon Icon Assets.car Illustrator Image Events ImageOptim Input Dictionary iPhone iWork Javascript Jedit Ω Json Label Language Link locationd lsappinfo m3u8 Mail Map Math Media Media AVAsset Media AVconvert Media AVFoundation Media AVURLAsset Media Movie Media Music Memo Messages Microsoft Microsoft Edge Microsoft Excel Microsoft Fonts Microsoft Office Microsoft Office Link Microsoft OneDrive Microsoft Teams Mouse Music Node Notes NSArray NSArray Sort NSAttributedString NSBezierPath NSBitmapImageRep NSBundle NSCFBoolean NSCharacterSet NSData NSDecimalNumber NSDictionary NSError NSEvent NSFileAttributes NSFileManager NSFileManager enumeratorAtURL NSFont NSFontManager NSGraphicsContext NSGraphicsContext Crop NSImage NSIndex NSKeyedArchiver NSKeyedUnarchiver NSLocale NSMetadataItem NSMutableArray NSMutableDictionary NSMutableString NSNotFound NSNumber NSOpenPanel NSPasteboard NSpoint NSPredicate NSRange NSRect NSRegularExpression NSRunningApplication NSScreen NSSet NSSize NSString NSString stringByApplyingTransform NSStringCompareOptions NSTask NSTimeZone NSUbiquitous NSURL NSURL File NSURLBookmark NSURLComponents NSURLResourceKey NSURLSession NSUserDefaults NSUUID NSView NSWorkspace Numbers OAuth PDF PDF Image2PDF PDF MakePDF PDF nUP PDF Pymupdf PDF Pypdf PDFContext PDFDisplayBox PDFImageRep PDFKit PDFKit Annotation PDFKit AnnotationWidget PDFKit DocumentPermissions PDFKit OCR PDFKit Outline PDFKit Start PDFPage PDFPage Rotation PDFView perl Photoshop PlistBuddy pluginkit plutil postalcode PostScript PowerShell prefPane Preview Python Python eyed3 Python pip QuickLook QuickTime ReadMe Regular Expression Reminders ReName Repeat RTF Safari SaveFile ScreenCapture ScreenSaver Script Editor Script Menu SF Symbols character id SF Symbols Entity Shortcuts Shortcuts Events sips Skype Slack Sound Spotlight sqlite StandardAdditions StationSearch Subtitles LRC Subtitles SRT Subtitles VTT Swift swiftDialog System Events System Settings TemporaryItems Terminal Text Text CSV Text MD Text TSV TextEdit Tools Translate Trash Twitter Typography UI Unit Conversion UTType valueForKeyPath Video VisionKit Visual Studio Code VMware Fusion Wacom Weather webarchive webp Wifi Windows XML XML EPUB XML HTML XML LSSharedFileList XML LSSharedFileList sfl2 XML LSSharedFileList sfl3 XML objectsForXQuery XML OPML XML Plist XML Plist System Events XML RSS XML savedSearch XML SVG XML TTML XML webloc XML xmllint XML XMP YouTube Zero Padding zoom