Wacom

[Wacom]ユーザー設定等をまとめてゴミ箱へ


あくまでも参考にしてください

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

サンプルソース(参考)
行番号ソース
001#! /usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#com.cocolog-nifty.quicktimer.icefloe
004----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
005use AppleScript version "2.8"
006use framework "Foundation"
007use framework "AppKit"
008use framework "UniformTypeIdentifiers"
009use scripting additions
010
011property refMe : a reference to current application
012
013
014set listBundleID to {"com.wacom.DataStoreMgr", "com.wacom.FirmwareUpdater", "com.wacom.IOManager", "com.wacom.MultiTouch", "com.wacom.ProfessionalControlPanel", "com.wacom.RemoveTabletHelper", "com.wacom.RemoveWacomTablet", "com.wacom.TabletDriver", "com.wacom.TabletHelper", "com.wacom.UpdateHelper", "com.wacom.UpgradeHelper", "com.wacom.Wacom-Desktop-Center", "com.wacom.Wacom-Display-Settings", "com.wacom.WacomCenter", "com.wacom.WacomCenterPrefPane", "com.wacom.WacomExperienceProgram", "com.wacom.WacomTabletDriver", "com.wacom.WacomTouchDriver", "com.wacom.displayhelper", "com.wacom.wacomtablet", "com.wacom.DisplayMgr"} as list
015
016set appFileManager to refMe's NSFileManager's defaultManager()
017set ocidHomeDirURL to appFileManager's homeDirectoryForCurrentUser()
018
019
020
021##############
022set ocidChkDirPathURL to (ocidHomeDirURL's URLByAppendingPathComponent:("Library/Containers"))
023repeat with itemBundleID in listBundleID
024  set ocidTargetPathURL to (ocidChkDirPathURL's URLByAppendingPathComponent:(itemBundleID))
025  #
026  set ocidTargetPath to ocidTargetPathURL's |path|()
027  #有無チェック
028  set boolDirExists to (appFileManager's fileExistsAtPath:(ocidTargetPath) isDirectory:(true))
029  if boolDirExists = true then
030    log (ocidTargetPath as text) & ": をゴミ箱に入れる"
031    set aliasChkDirPath to (ocidTargetPathURL's absoluteURL()) as alias
032    tell application "Finder"
033      move aliasChkDirPath to the trash
034    end tell
035  end if
036end repeat
037
038##############
039set ocidChkDirPathURL to (ocidHomeDirURL's URLByAppendingPathComponent:("Library/Caches"))
040repeat with itemBundleID in listBundleID
041  set ocidTargetPathURL to (ocidChkDirPathURL's URLByAppendingPathComponent:(itemBundleID))
042  #
043  set ocidTargetPath to ocidTargetPathURL's |path|()
044  #有無チェック
045  set boolDirExists to (appFileManager's fileExistsAtPath:(ocidTargetPath) isDirectory:(true))
046  if boolDirExists = true then
047    log (ocidTargetPath as text) & ": をゴミ箱に入れる"
048    set listDone to (appFileManager's trashItemAtURL:(ocidTargetPathURL) resultingItemURL:(ocidTargetPathURL) |error| :(reference))
049    if (item 2 of listDone) ≠ (missing value) then
050      set strDirPath to (ocidTargetPathURL's |path|()) as text
051      set strErrorMes to (item 2 of listDone)'s localizedDescription() as text
052      #
053      set strMes to ("【エラー】\n" & strDirPath & "\n" & strErrorMes) as text
054      log strMes
055    else if (item 1 of listDone) is true then
056      log "正常終了 : " & (ocidDirPathURL's |path|()) as text
057    end if
058  end if
059end repeat
060
061
062##############
063set ocidChkDirPathURL to (ocidHomeDirURL's URLByAppendingPathComponent:("Library/WebKit"))
064repeat with itemBundleID in listBundleID
065  set ocidTargetPathURL to (ocidChkDirPathURL's URLByAppendingPathComponent:(itemBundleID))
066  set listDone to (appFileManager's trashItemAtURL:(ocidTargetPathURL) resultingItemURL:(ocidTargetPathURL) |error| :(reference))
067  if (item 2 of listDone) ≠ (missing value) then
068    set strDirPath to (ocidTargetPathURL's |path|()) as text
069    set strErrorMes to (item 2 of listDone)'s localizedDescription() as text
070    #
071    set strMes to ("【エラー】\n" & strDirPath & "\n" & strErrorMes) as text
072    log strMes
073  else if (item 1 of listDone) is true then
074    log "正常終了 : " & (ocidDirPathURL's |path|()) as text
075  end if
076end repeat
077
078##############
079set ocidChkDirPathURL to (ocidHomeDirURL's URLByAppendingPathComponent:("Library/Saved Application State"))
080repeat with itemBundleID in listBundleID
081  set ocidTargetPathURL to (ocidChkDirPathURL's URLByAppendingPathComponent:(itemBundleID))
082  set listDone to (appFileManager's trashItemAtURL:(ocidTargetPathURL) resultingItemURL:(ocidTargetPathURL) |error| :(reference))
083  if (item 2 of listDone) ≠ (missing value) then
084    set strDirPath to (ocidTargetPathURL's |path|()) as text
085    set strErrorMes to (item 2 of listDone)'s localizedDescription() as text
086    #
087    set strMes to ("【エラー】\n" & strDirPath & "\n" & strErrorMes) as text
088    log strMes
089  else if (item 1 of listDone) is true then
090    log "正常終了 : " & (ocidDirPathURL's |path|()) as text
091  end if
092end repeat
093
094
095##############
096set ocidChkDirPathURL to (ocidHomeDirURL's URLByAppendingPathComponent:("Library/HTTPStorages"))
097repeat with itemBundleID in listBundleID
098  set ocidTargetPathURL to (ocidChkDirPathURL's URLByAppendingPathComponent:(itemBundleID))
099  set listDone to (appFileManager's trashItemAtURL:(ocidTargetPathURL) resultingItemURL:(ocidTargetPathURL) |error| :(reference))
100  if (item 2 of listDone) ≠ (missing value) then
101    set strDirPath to (ocidTargetPathURL's |path|()) as text
102    set strErrorMes to (item 2 of listDone)'s localizedDescription() as text
103    #
104    set strMes to ("【エラー】\n" & strDirPath & "\n" & strErrorMes) as text
105    log strMes
106  else if (item 1 of listDone) is true then
107    log "正常終了 : " & (ocidDirPathURL's |path|()) as text
108  end if
109end repeat
110
111
112##############
113set ocidChkDirPathURL to (ocidHomeDirURL's URLByAppendingPathComponent:("Library/Group Containers"))
114repeat with itemBundleID in listBundleID
115  set ocidTargetPathURL to (ocidChkDirPathURL's URLByAppendingPathComponent:(itemBundleID))
116  set listDone to (appFileManager's trashItemAtURL:(ocidTargetPathURL) resultingItemURL:(ocidTargetPathURL) |error| :(reference))
117  if (item 2 of listDone) ≠ (missing value) then
118    set strDirPath to (ocidTargetPathURL's |path|()) as text
119    set strErrorMes to (item 2 of listDone)'s localizedDescription() as text
120    #
121    set strMes to ("【エラー】\n" & strDirPath & "\n" & strErrorMes) as text
122    log strMes
123  else if (item 1 of listDone) is true then
124    log "正常終了 : " & (ocidTargetPathURL's |path|()) as text
125  end if
126end repeat
127
AppleScriptで生成しました

|

[Driver]ログイン時に開く にWACOMのドライバーを登録する

こうなります
Screen-20231024-154705

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions
property refMe : a reference to current application

####アプリケーションフォルダ
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSApplicationDirectory) inDomains:(refMe's NSLocalDomainMask))
set ocidApplicationDirPathURL to ocidURLsArray's firstObject()
####
set ocidTabletDriverURL to ocidApplicationDirPathURL's URLByAppendingPathComponent:("Wacom Tablet.localized/.Tablet/TabletDriver.app")
set ocidWacomTabletDriverURL to ocidApplicationDirPathURL's URLByAppendingPathComponent:("Wacom Tablet.localized/.Tablet/WacomTabletDriver.app")
set ocidWacomTouchDriverURL to ocidApplicationDirPathURL's URLByAppendingPathComponent:("Wacom Tablet.localized/.Tablet/WacomTouchDriver.app")
####
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSLocalDomainMask))
set ocidLibraryDirPathURL to ocidURLsArray's firstObject()
set ocidIOManagerURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("PrivilegedHelperTools/com.wacom.IOManager.app")
###
try
  set strTabletDriverURL to (ocidTabletDriverURL's |path|()) as text
  set strWacomTabletDriverURL to (ocidWacomTabletDriverURL's |path|()) as text
  set strWacomTouchDriverURL to (ocidWacomTouchDriverURL's |path|()) as text
  set strIOManagerURL to (ocidIOManagerURL's |path|()) as text
on error
return "WACOMのドライバーが正しくインストールされていません"
end try

tell application "System Events"
  make login item at end with properties {name:"TabletDriver.app", path:strTabletDriverURL, class:login item, kind:"アプリケーション", hidden:true}
end tell

tell application "System Events"
  make login item at end with properties {name:"WacomTabletDriver.app", path:strWacomTabletDriverURL, class:login item, kind:"アプリケーション", hidden:true}
end tell


tell application "System Events"
  make login item at end with properties {name:"WacomTouchDriver.app", path:strWacomTouchDriverURL, class:login item, kind:"アプリケーション", hidden:true}
end tell

tell application "System Events"
  make login item at end with properties {name:"com.wacom.IOManager.app", path:strIOManagerURL, class:login item, kind:"アプリケーション", hidden:true}
end tell


|

[wacom]起動項目

アプリケーションに書き出して 起動項目に

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

#!/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 listUTI to {"com.wacom.WacomCenter", "com.wacom.wacomtablet", "com.wacom.IOManager", "com.wacom.WacomTouchDriver"} as list
##タブレットドライバ用
set listUTI to {"com.wacom.WacomCenter", "com.wacom.wacomtablet", "com.wacom.IOManager", "com.wacom.TabletDriver"} as list

repeat with itemUTI in listUTI
  tell application id itemUTI
    launch
  end tell
end repeat
###起動


###隠す処理
tell application "System Events"
  tell application process "Wacom Center"
    set visible to false
  end tell
end tell





|

[wacom]関連プロセス終了


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

#!/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 framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

set listUTI to {"com.wacom.TabletDriver", "com.wacom.DataStoreMgr", "com.wacom.FirmwareUpdater", "com.wacom.IOManager", "com.wacom.MultiTouch", "com.wacom.ProfessionalControlPanel", "com.wacom.RemoveTabletHelper", "com.wacom.RemoveWacomTablet", "com.wacom.TabletDriver", "com.wacom.TabletHelper", "com.wacom.UpdateHelper", "com.wacom.UpgradeHelper", "com.wacom.Wacom-Desktop-Center", "com.wacom.Wacom-Display-Settings", "com.wacom.WacomCenter", "com.wacom.WacomCenterPrefPane", "com.wacom.WacomExperienceProgram", "com.wacom.WacomTabletDriver", "com.wacom.WacomTouchDriver", "com.wacom.displayhelper", "com.wacom.wacomtablet", "com.wacom.DisplayMgr"} as list

repeat with itemUTI in listUTI
  ###NSRunningApplication
  set ocidRunningApplication to refMe's NSRunningApplication
  ###起動中のすべてのリスト
  set ocidAppArray to (ocidRunningApplication's runningApplicationsWithBundleIdentifier:(itemUTI))
  ###複数起動時も順番に終了
  repeat with itemAppArray in ocidAppArray
itemAppArray's terminate()
  end repeat
end repeat
log "通常終了"
delay 3

repeat with itemUTI in listUTI
  ###NSRunningApplication
  set ocidRunningApplication to refMe's NSRunningApplication
  ###起動中のすべてのリスト
  set ocidAppArray to (ocidRunningApplication's runningApplicationsWithBundleIdentifier:(itemUTI))
  ###複数起動時も順番に終了
  repeat with itemAppArray in ocidAppArray
itemAppArray's forceTerminate()
  end repeat
end repeat

log "強制終了"




|

[Wacom]ドライバー削除 BASH


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

#!/bin/bash

########################################
###管理者インストールしているか?チェック
USER_WHOAMI=$(/usr/bin/whoami)
/bin/echo "実行したユーザーは:$USER_WHOAMI"
NUM_UID=$(/usr/bin/id -u)
/bin/echo "実行ユーザーIDは:" "$NUM_UID"
if [ "$USER_WHOAMI" != "root" ]; then
  /bin/echo "このスクリプトを実行するには管理者権限が必要です。"
  /usr/bin/printf "sudo で実行してください\n\n"
  ### path to me
  SCRIPT_PATH="${BASH_SOURCE[0]}"
  /bin/echo "/usr/bin/sudo \"$SCRIPT_PATH\""
  /usr/bin/printf "\n ↑ を実行してください\n\n"
  exit 1
else
  ###実行しているユーザー名
  SUDO_USER=$(/bin/echo "$HOME" | /usr/bin/awk -F'/' '{print $NF}')
  /bin/echo "実行ユーザー:" "$SUDO_USER"
  NUM_UID=$(/usr/bin/sudo -u "$SUDO_USER" /usr/bin/id -u)
  /bin/echo "実行ユーザーIDは:" "$NUM_UID"
fi

################################################################
/usr/sbin/spctl --master-disable

/usr/bin/killall "WacomTouchDriver"
/usr/bin/killall "WacomTabletDriver"
/usr/bin/killall "Wacom Desktop Center"
/usr/bin/killall "TabletDriver"
/usr/bin/killall "com.wacom.DataStoreMgr"
/usr/bin/killall "com.wacom.IOManager"
/usr/bin/killall "com.wacom.UpdateHelper"

LIST_UTI=("com.wacom.DataStoreMgr" "com.wacom.FirmwareUpdater" "com.wacom.IOManager" "com.wacom.MultiTouch" "com.wacom.ProfessionalControlPanel" "com.wacom.RemoveTabletHelper" "com.wacom.RemoveWacomTablet" "com.wacom.TabletDriver" "com.wacom.TabletHelper" "com.wacom.UpdateHelper" "com.wacom.UpgradeHelper" "com.wacom.Wacom-Desktop-Center" "com.wacom.Wacom-Display-Settings" "com.wacom.WacomCenter" "com.wacom.WacomCenterPrefPane" "com.wacom.WacomExperienceProgram" "com.wacom.WacomTabletDriver" "com.wacom.WacomTouchDriver" "com.wacom.displayhelper" "com.wacom.wacomtablet" "com.wacom.DisplayMgr")

for ITEM_UTI in "${LIST_UTI[@]}"; do
  /bin/echo "$ITEM_UTI"
  STR_FILE_PATH="/Library/LaunchDaemons/$ITEM_UTI.plist"
  if [ -f "$STR_FILE_PATH" ]; then
    /bin/launchctl stop -w "$STR_FILE_PATH"
    /bin/launchctl unload -w "$STR_FILE_PATH"
    /bin/launchctl bootout -w "$STR_FILE_PATH"
    /bin/rm "$STR_FILE_PATH"
  fi
  STR_FILE_PATH="/Library/LaunchAgents/$ITEM_UTI.plist"
  if [ -f "$STR_FILE_PATH" ]; then
    /bin/launchctl stop -w "$STR_FILE_PATH"
    /bin/launchctl unload -w "$STR_FILE_PATH"
    /bin/launchctl bootout -w "$STR_FILE_PATH"
    /bin/rm "$STR_FILE_PATH"
  fi
done

################################################################
/bin/mkdir -p /var/folders/TemporaryItems
/bin/chmod -Rf 777 /var/folders/TemporaryItems

/sbin/kextunload -b "Wacom Tablet"
/sbin/kextunload -b "Pen Tablet"
/sbin/kextunload -b "SiLabsUSBDriver"
/sbin/kextunload -b "SiLabsUSBDriver64"

################################################################
#####古いファイルをゴミ箱に LOCAL
function DO_MOVE_TO_TRASH() {
  if [ -e "$1" ]; then
    TRASH_DIR=$(/usr/bin/mktemp -d "/var/folders/TemporaryItems/XXXXXXXX")
    /bin/chmod 777 "$TRASH_DIR"
    /bin/mv "$1" "$TRASH_DIR"
    ##削除
    /usr/bin/find "$TRASH_DIR" -mindepth 1 -delete
  fi
}
#####古いファイルをゴミ箱に LOCAL
DO_MOVE_TO_TRASH "/Applications/Wacom Tablet.localized"

DO_MOVE_TO_TRASH "/Library/Application Support/Tablet"
DO_MOVE_TO_TRASH "/Library/Application Support/Wacom"

DO_MOVE_TO_TRASH "/Library/Extensions/Wacom Tablet.kex"
DO_MOVE_TO_TRASH "/Library/Extensions/Pen Tablet.kext"

DO_MOVE_TO_TRASH "/Library/Frameworks/WacomMultiTouch.framework"

DO_MOVE_TO_TRASH "/Library/Internet Plug-Ins/WacomNetscape.plugin"
DO_MOVE_TO_TRASH "/Library/Internet Plug-Ins/WacomSafari.plugin"
DO_MOVE_TO_TRASH "/Library/Internet Plug-Ins/WacomTabletPlugin.plugin"

DO_MOVE_TO_TRASH "/Library/PreferencePanes/WacomTablet.prefpane"
DO_MOVE_TO_TRASH "/Library/PreferencePanes/WacomCenter.prefpane"
DO_MOVE_TO_TRASH "/Library/PreferencePanes/PenTablet.prefpane"

DO_MOVE_TO_TRASH "/Library/Preferences/Tablet"

DO_MOVE_TO_TRASH "/Library/StartupItems/Tablet"

DO_MOVE_TO_TRASH "/Library/Receipts/InstallConsumerTablet.pkg"
DO_MOVE_TO_TRASH "/Library/Receipts/InstallProTablet.pkg"
DO_MOVE_TO_TRASH "/Library/Receipts/InstallSemiproTablet.pkg"

DO_MOVE_TO_TRASH "/Library/PrivilegedHelperTools/com.wacom.DataStoreMgr.app"
DO_MOVE_TO_TRASH "/Library/PrivilegedHelperTools/com.wacom.IOManager.app"
DO_MOVE_TO_TRASH "/Library/PrivilegedHelperTools/com.wacom.UpdateHelper.app"

###USBドライバーは他で使ってないか?確認が必要かな
DO_MOVE_TO_TRASH "/Library/Extensions/SiLabsUSBDriver.kext"
DO_MOVE_TO_TRASH "/Library/Extensions/SiLabsUSBDriver64.kext"


for ITEM_UTI in "${LIST_UTI[@]}"; do
  /bin/echo "処理するUTI:" "$ITEM_UTI"
  STR_FILE_PATH="/Library/PrivilegedHelperTools/$ITEM_UTI.app"
  DO_MOVE_TO_TRASH "$STR_FILE_PATH"
  STR_FILE_PATH="/Library/Preferences/$ITEM_UTI.plist"
  DO_MOVE_TO_TRASH "$STR_FILE_PATH"
done

############################################################
###ローカルのユーザーアカウントを取得
TEXT_RESULT=$(/usr/bin/dscl localhost -list /Local/Default/Users PrimaryGroupID | /usr/bin/awk '$2 == 20 { print $1 }')
###リストにする
read -d '\\n' -r -a LIST_USER <<<"$TEXT_RESULT"
###リスト内の項目数
NUM_CNT=${#LIST_USER[@]}
/bin/echo "ユーザー数:" "$NUM_CNT"
############################################################
##リストの内容を順番に処理
for ITEM_USER in "${LIST_USER[@]}"; do
  /bin/echo "ITEM_USER:MKDIR:" "ITEM_USER"
  ##ライブラリの不可視属性を解除
  /usr/bin/sudo -u "$ITEM_USER" /usr/bin/chflags nohidden "/Users/$ITEM_USER/Library"
  /usr/bin/sudo -u "$ITEM_USER" /usr/bin/SetFile -a v "/Users/$ITEM_USER/Library"
  ##ユーザーアプリケーションフォルダを作る
  /usr/bin/sudo -u "$ITEM_USER" /bin/mkdir -p "/Users/$ITEM_USER/Applications"
  /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 700 "/Users/$ITEM_USER/Applications"
  /usr/bin/sudo -u "$ITEM_USER" /usr/sbin/chown "$ITEM_USER" "/Users/$ITEM_USER/Applications"
  /usr/bin/sudo -u "$ITEM_USER" /usr/bin/touch "/Users/$ITEM_USER/Applications/.localized"
  ##ユーザーユーティリティフォルダを作る
  /usr/bin/sudo -u "$ITEM_USER" /bin/mkdir -p "/Users/$ITEM_USER/Applications/Utilities"
  /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 755 "/Users/$ITEM_USER/Applications/Utilities"
  /usr/bin/sudo -u "$ITEM_USER" /usr/sbin/chown "$ITEM_USER" "/Users/$ITEM_USER/Applications/Utilities"
  /usr/bin/sudo -u "$ITEM_USER" /usr/bin/touch "/Users/$ITEM_USER/Applications/Utilities/.localized"
  ## Managed Itemsフォルダを作る
  /usr/bin/sudo -u "$ITEM_USER" /bin/mkdir -p "/Users/$ITEM_USER/Library/Managed Items"
  /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 755 "/Users/$ITEM_USER/Library/Managed Items"
  /usr/bin/sudo -u "$ITEM_USER" /usr/sbin/chown "$ITEM_USER" "/Users/$ITEM_USER/Library/Managed Items"
  /usr/bin/sudo -u "$ITEM_USER" /usr/bin/touch "/Users/$ITEM_USER/Library/Managed Items/.localized"
  ##アクセス権チェック
  /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 700 "/Users/$ITEM_USER/Library"
  /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 777 "/Users/$ITEM_USER/Library/Caches"
  /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 700 "/Users/$ITEM_USER/Movies"
  /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 700 "/Users/$ITEM_USER/Music"
  /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 700 "/Users/$ITEM_USER/Pictures"
  /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 700 "/Users/$ITEM_USER/Downloads"
  /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 700 "/Users/$ITEM_USER/Documents"
  /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 700 "/Users/$ITEM_USER/Desktop"
  ##全ローカルユーザーに対して実施したい処理があれば追加する

  /bin/echo "ユーザーディレクトリチェックDONE"
done
############################################################
##ユーザーエージェント停止
for ITEM_USER in "${LIST_USER[@]}"; do
  /bin/echo "ITEM_USER:MKDIR:" "$ITEM_USER"
  for ITEM_UTI in "${LIST_UTI[@]}"; do
    STR_FILE_PATH="/Users/$ITEM_USER/Library/LaunchAgents/$ITEM_UTI.plist"
    if [ -f "$STR_FILE_PATH" ]; then
      /usr/bin/sudo -u "$ITEM_USER" /bin/launchctl stop -w "$STR_FILE_PATH"
      /usr/bin/sudo -u "$ITEM_USER" /bin/launchctl unload -w "$STR_FILE_PATH"
      /usr/bin/sudo -u "$ITEM_USER" /bin/launchctl bootout -w "$STR_FILE_PATH"
      /usr/bin/sudo -u "$ITEM_USER" /bin/rm "$STR_FILE_PATH"
    fi
  done
done
############################################################
##ユーザー環境リセット
for ITEM_USER in "${LIST_USER[@]}"; do
  /bin/echo "ITEM_USER:ユーザー環境削除:" "$ITEM_USER"
  function DO_MOVE_TO_TRASH_USER() {
    if [ -e "$1" ]; then
      TRASH_DIR=$(/usr/bin/sudo -u "$ITEM_USER" /usr/bin/mktemp -d)
      /usr/bin/sudo -u "$ITEM_USER" /bin/chmod 777 "$TRASH_DIR"
      /usr/bin/sudo -u "$ITEM_USER" /bin/mv "$1" "$TRASH_DIR"
      ##削除
      /usr/bin/sudo -u "$ITEM_USER" /usr/bin/find "$TRASH_DIR" -mindepth 1 -delete
    fi
}
  for ITEM_UTI in "${LIST_UTI[@]}"; do
    DO_MOVE_TO_TRASH_USER "/Users/$ITEM_USER/Library/Application Scripts/EG27766DY7.$ITEM_UTI"
    DO_MOVE_TO_TRASH_USER "/Users/$ITEM_USER/Library/Application Scripts/$ITEM_UTI"
    DO_MOVE_TO_TRASH_USER "/Users/$ITEM_USER/Library/Caches/$ITEM_UTI"
    DO_MOVE_TO_TRASH_USER "/Users/$ITEM_USER/Library/WebKit/$ITEM_UTI"
    DO_MOVE_TO_TRASH_USER "/Users/$ITEM_USER/Library/Saved Application State/$ITEM_UTI.savedState"
    DO_MOVE_TO_TRASH_USER "/Users/$ITEM_USER/Library/HTTPStorages/$ITEM_UTI"
    DO_MOVE_TO_TRASH_USER "/Users/$ITEM_USER/Library/Containers/$ITEM_UTI"

    DO_MOVE_TO_TRASH_USER "/Users/$ITEM_USER/Library/Group Containers/group.EG27766DY7.$ITEM_UTI"
    DO_MOVE_TO_TRASH_USER "/Users/$ITEM_USER/Library/Group Containers/EG27766DY7.$ITEM_UTI"
    DO_MOVE_TO_TRASH_USER "/Users/$ITEM_USER/Library/Group Containers/$ITEM_UTI"
  done

done

############################################################
## TCCリセット
for ITEM_USER in "${LIST_USER[@]}"; do
  /bin/echo "ITEM_USER:TCCリセット:" "$ITEM_USER"
  for ITEM_UTI in "${LIST_UTI[@]}"; do
    /usr/bin/sudo -u "$ITEM_USER" /usr/bin/tccutil reset "$ITEM_UTI"
  done
done
exit 0


|

[Wacom]ドライバー関連(設定も)全部削除

#!/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

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL

set objFileManager to refMe's NSFileManager's defaultManager()


try
set strGoToTrashPath to "/Applications/Wacom Tablet.localized" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
tell application "Finder" to activate
try
set strGoToTrashPath to "/Library/Application Support/Tablet" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strGoToTrashPath to "/Library/PrivilegedHelperTools/com.wacom.DataStoreMgr.app" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strGoToTrashPath to "/Library/PrivilegedHelperTools/com.wacom.IOManager.app" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strGoToTrashPath to "/Library/PrivilegedHelperTools/com.wacom.UpdateHelper.app" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strGoToTrashPath to "/Library/Preferences/Tablet" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strGoToTrashPath to "/Library/PreferencePanes/WacomCenter.prefpane" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strGoToTrashPath to "/Library/PreferencePanes/WacomTablet.prefpane" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strGoToTrashPath to "/Library/PreferencePanes/PenTablet.prefpane" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strGoToTrashPath to "/Library/Frameworks/WacomMultiTouch.framework" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strGoToTrashPath to "/Library/Internet Plug-Ins/WacomTabletPlugin.plugin" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strGoToTrashPath to "/Library/Internet Plug-Ins/WacomSafari.plugin" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strGoToTrashPath to "/Library/Internet Plug-Ins/WacomNetscape.plugin" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try

#################################
#####temporaryDirectory
set ocidTemporaryDirUrl to objFileManager's temporaryDirectory()
set ocidTemporaryDirUserUrl to ocidTemporaryDirUrl's URLByDeletingLastPathComponent()
log ocidTemporaryDirUserUrl as text
log className() of ocidTemporaryDirUserUrl as text
set ocidTemporaryDirURLC to ocidTemporaryDirUserUrl's URLByAppendingPathComponent:"C"
set ocidTemporaryDirURLT to ocidTemporaryDirUserUrl's URLByAppendingPathComponent:"T"
#################################
#####Library
set ocidUserLibraryPathArray to (objFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidUserLibraryPath to item 1 of ocidUserLibraryPathArray
set ocidLibraryDirURLAs to ocidUserLibraryPath's URLByAppendingPathComponent:"Application Scripts"
set ocidLibraryDirURLCont to ocidUserLibraryPath's URLByAppendingPathComponent:"Containers"
set ocidLibraryDirURLGs to ocidUserLibraryPath's URLByAppendingPathComponent:"Group Containers"
set ocidLibraryDirURLLa to ocidUserLibraryPath's URLByAppendingPathComponent:"LaunchAgents"


set listPlist to {"com.wacom.Wacom-Display-Settings.plist", "com.wacom.Wacom-Desktop-Center.plist", "com.wacom.wacomtablet.plist", "com.wacom.IOManager.plist", "com.wacom.DataStoreMgr.plist", "com.wacom.UpdateHelper.plist", "com.wacom.displayhelper.plist", "com.wacom.wacomtablet.plist", "com.wacom.RemoveTabletHelper.plist", "com.wacom.TabletHelper.plist", "com.wacom.UpdateHelper.plist"}

repeat with itemPlist in listPlist
set ocidGoToTrashPathURL to (ocidLibraryDirURLLa's URLByAppendingPathComponent:itemPlist)
####ゴミ箱に入れる
set listDoneGoToTrash to (objFileManager's trashItemAtURL:ocidGoToTrashPathURL resultingItemURL:(missing value) |error|:(reference))
log item 1 of listDoneGoToTrash
log item 2 of listDoneGoToTrash
try
set strCommandText to ("/usr/bin/sudo /bin/launchctl unload /Library/LaunchDaemons/" & itemPlist & "") as text
do shell script strCommandText with administrator privileges
end try
try
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"/Library/LaunchDaemons/" & itemPlist & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strCommandText to ("/usr/bin/sudo /bin/launchctl unload /Library/LaunchAgents/" & itemPlist & "") as text
do shell script strCommandText with administrator privileges
end try
try
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"/Library/LaunchAgents/" & itemPlist & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set strCommandText to ("/bin/launchctl unload $HOME/Library/LaunchAgents/" & itemPlist & "") as text
do shell script strCommandText with administrator privileges
end try
end repeat



set listUTI to {"com.wacom.DataStoreMgr", "com.wacom.IOManager", "com.wacom.RemoveWacomTablet", "com.wacom.TabletDriver", "com.wacom.UpgradeHelper", "com.wacom.WacomCenter ", "com.wacom.WacomExperienceProgram", "com.wacom.wacomtablet", "com.wacom.WacomTouchDriver", "EG27766DY7.com.wacom.WacomTabletDriver", "group.com.wacom.TabletDriver", "group.EG27766DY7.com.wacom.WacomTabletDriver", "com.wacom.WacomCenter"} as list


repeat with itemUTI in listUTI


set ocidGoToTrashPathURL to (ocidTemporaryDirURLC's URLByAppendingPathComponent:itemUTI)
####ゴミ箱に入れる
set listDoneGoToTrash to (objFileManager's trashItemAtURL:ocidGoToTrashPathURL resultingItemURL:(missing value) |error|:(reference))
log item 1 of listDoneGoToTrash
log item 2 of listDoneGoToTrash

set ocidGoToTrashPathURL to (ocidTemporaryDirURLT's URLByAppendingPathComponent:itemUTI)
####ゴミ箱に入れる
set listDoneGoToTrash to (objFileManager's trashItemAtURL:ocidGoToTrashPathURL resultingItemURL:(missing value) |error|:(reference))
log item 1 of listDoneGoToTrash
log item 2 of listDoneGoToTrash

set ocidGoToTrashPathURL to (ocidLibraryDirURLAs's URLByAppendingPathComponent:itemUTI)
####ゴミ箱に入れる
set listDoneGoToTrash to (objFileManager's trashItemAtURL:ocidGoToTrashPathURL resultingItemURL:(missing value) |error|:(reference))
log item 1 of listDoneGoToTrash
log item 2 of listDoneGoToTrash


set ocidGoToTrashPathURL to (ocidLibraryDirURLCont's URLByAppendingPathComponent:itemUTI)
####ゴミ箱に入れる
set listDoneGoToTrash to (objFileManager's trashItemAtURL:ocidGoToTrashPathURL resultingItemURL:(missing value) |error|:(reference))
log item 1 of listDoneGoToTrash
log item 2 of listDoneGoToTrash

set ocidGoToTrashPathURL to (ocidLibraryDirURLGs's URLByAppendingPathComponent:itemUTI)
####ゴミ箱に入れる
set listDoneGoToTrash to (objFileManager's trashItemAtURL:ocidGoToTrashPathURL resultingItemURL:(missing value) |error|:(reference))
log item 1 of listDoneGoToTrash
log item 2 of listDoneGoToTrash

end repeat

try
set theComand to ("/usr/bin/sudo /sbin/kextunload -b SiLabsUSBDriver") as text
do shell script theComand with administrator privileges
end try
try
set strGoToTrashPath to "/Library/Extensions/SiLabsUSBDriver.kext" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try

try
set theComand to ("/usr/bin/sudo /sbin/kextunload -b SiLabsUSBDriver64") as text
do shell script theComand with administrator privileges
end try
try
set strGoToTrashPath to "/Library/Extensions/SiLabsUSBDriver64.kext" as text

set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try
set theComand to ("/usr/bin/sudo /sbin/kextunload -b \"Wacom Tablet\"") as text
do shell script theComand with administrator privileges
end try
try
set strGoToTrashPath to "/Library/Extensions/Wacom Tablet.kext" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try
try

set theComand to ("/usr/bin/sudo /sbin/kextunload -b \"Pen Tablet\"") as text
do shell script theComand with administrator privileges
end try
try
set strGoToTrashPath to "/Library/Extensions/Pen Tablet.kext" as text
set strCommandText to ("/usr/bin/osascript -e 'tell application \"Finder\" to move POSIX file \"" & strGoToTrashPath & "\" as alias to the trash'") as text
do shell script strCommandText with administrator privileges
end try

|

その他のカテゴリー

Accessibility Acrobat Acrobat 2020 Acrobat AddOn Acrobat Annotation Acrobat ARMDC Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat JS Acrobat Manifest Acrobat Menu Acrobat Open Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat python Acrobat Reader Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat Watermark Acrobat Windows Acrobat Windows Reader Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin Support Admin System Information Admin Tools Admin Users Admin Volumes Adobe Adobe FDKO Adobe RemoteUpdateManager AppKit Apple AppleScript AppleScript do shell script AppleScript List AppleScript ObjC AppleScript Osax AppleScript PDF AppleScript Pictures AppleScript record AppleScript Script Editor AppleScript Script Menu AppleScript Shortcuts AppleScript Shortcuts Events AppleScript System Events AppleScript System Events Plist AppleScript Video Applications AppStore Archive Attributes Automator BackUp Barcode Barcode QR Barcode QR Decode Bash Basic Basic Path Bluetooth BOX Browser Calendar CD/DVD Choose Chrome CIImage CityCode CloudStorage Color com.apple.LaunchServices.OpenWith Console Contacts CotEditor CURL current application Date&Time delimiters Desktop Device Diff Disk Dock DropBox Droplet eMail Encode % Encode Decode Encode UTF8 Error EXIFData ffmpeg File Finder Firefox Folder FolderAction Fonts GIF github Guide HTML HTML Entity Icon Illustrator Image Events Image2PDF ImageOptim iPhone iWork Javascript Jedit Json Label Leading Zero List locationd LRC lsappinfo LSSharedFileList m3u8 Mail MakePDF Map Math Media Media AVAsset Media AVconvert Media AVFoundation Media AVURLAsset Media Movie Media Music Memo Messages Microsoft Microsoft Edge Microsoft Excel Mouse Music NetWork Notes NSArray NSArray Sort NSBezierPath NSBitmapImageRep NSBundle NSCFBoolean NSCharacterSet NSColor NSColorList NSData NSDecimalNumber NSDictionary NSError NSEvent NSFileAttributes NSFileManager NSFileManager enumeratorAtURL NSFont NSFontManager NSGraphicsContext NSImage NSIndex NSKeyedArchiver NSKeyedUnarchiver NSLocale NSMutableArray NSMutableDictionary NSMutableString NSNotFound NSNumber NSOpenPanel NSPasteboard NSpoint NSPredicate NSPrintOperation NSRange NSRect NSRegularExpression NSRunningApplication NSScreen NSSize NSString NSString stringByApplyingTransform NSStringCompareOptions NSTask NSTimeZone NSURL NSURL File NSURLBookmark NSURLComponents NSURLResourceKey NSURLSession NSUserDefaults NSUUID NSView NSWorkspace Numbers OAuth OneDrive PDF PDFAnnotation PDFAnnotationWidget PDFContext PDFDisplayBox PDFDocumentPermissions PDFImageRep PDFKit PDFnUP PDFOutline perl Photoshop PlistBuddy pluginkit postalcode PostScript prefPane Preview Python QuickLook QuickTime ReadMe Regular Expression Reminders ReName Repeat RTF Safari SaveFile ScreenCapture ScreenSaver SF Symbols character id SF Symbols Entity sips Skype Slack Sound Spotlight sqlite SRT StandardAdditions Swift System Settings TCC 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 Wacom webarchive webp Wifi Windows XML XML EPUB XML OPML XML Plist XML RSS XML savedSearch XML SVG XML TTML XML webloc XML XMP YouTube zoom