Acrobat AV2

[Acrobat]Av2新UIの設定をFALSEにするPlistBuddy版(修正)


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004(*
005前提
006Adobe Acrobat Acrobat Reader
007アプリケーションを終了させてから
00810秒程度経過してから
009実行してください
010EnableAV2の設定は仕様でロックできないので
011ユーザーが切り替える事は可能
012
013修正版 20241003
014*)
015#com.cocolog-nifty.quicktimer.icefloe
016----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
017use AppleScript version "2.8"
018use framework "Foundation"
019use framework "AppKit"
020use scripting additions
021property refMe : a reference to current application
022
023
024##パス製品版
025set appFileManager to refMe's NSFileManager's defaultManager()
026set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
027set ocidLibraryDirPathURL to ocidURLsArray's firstObject()
028##PLISTへのパス まずは 製品版
029set ocidPlistFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/com.adobe.Acrobat.Pro.plist")
030set strPlistFilePath to (ocidPlistFilePathURL's |path|()) as text
031########################################################
032#######AVGeneral:IPMEnableAV2AcrobatNewUser
033try
034  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:IPMEnableAV2AcrobatNewUser:0\" \"" & strPlistFilePath & "\"") as text
035  set strResponse to (do shell script strCommandText) as text
036on error
037  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:AVGeneral:IPMEnableAV2AcrobatNewUser array\" \"" & strPlistFilePath & "\"") as text
038  do shell script strCommandText
039  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:AVGeneral:IPMEnableAV2AcrobatNewUser:0 integer 0\" \"" & strPlistFilePath & "\"") as text
040  do shell script strCommandText
041  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:AVGeneral:IPMEnableAV2AcrobatNewUser:1 bool false\" \"" & strPlistFilePath & "\"") as text
042  do shell script strCommandText
043end try
044set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:IPMEnableAV2AcrobatNewUser:0 integer 0\" \"" & strPlistFilePath & "\"") as text
045do shell script strCommandText
046set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:IPMEnableAV2AcrobatNewUser:1 bool false\" \"" & strPlistFilePath & "\"") as text
047do shell script strCommandText
048
049
050#######AVGeneral:NumSwitcherContextualToolTipAV2Shown
051try
052  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:NumSwitcherContextualToolTipAV2Shown:0\" \"" & strPlistFilePath & "\"") as text
053  set strResponse to (do shell script strCommandText) as text
054on error
055  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:AVGeneral:NumSwitcherContextualToolTipAV2Shown array\" \"" & strPlistFilePath & "\"") as text
056  do shell script strCommandText
057  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:AVGeneral:NumSwitcherContextualToolTipAV2Shown:0 integer 0\" \"" & strPlistFilePath & "\"") as text
058  do shell script strCommandText
059  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:AVGeneral:NumSwitcherContextualToolTipAV2Shown:1 bool false\" \"" & strPlistFilePath & "\"") as text
060  do shell script strCommandText
061end try
062set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:NumSwitcherContextualToolTipAV2Shown:0 integer 0\" \"" & strPlistFilePath & "\"") as text
063do shell script strCommandText
064set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:NumSwitcherContextualToolTipAV2Shown:1 bool false\" \"" & strPlistFilePath & "\"") as text
065do shell script strCommandText
066#######AVGeneral:EnableAV2
067try
068  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:EnableAV2:0\" \"" & strPlistFilePath & "\"") as text
069  set strResponse to (do shell script strCommandText) as text
070on error
071  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:AVGeneral:EnableAV2 array\" \"" & strPlistFilePath & "\"") as text
072  do shell script strCommandText
073  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:AVGeneral:EnableAV2:0 integer 0\" \"" & strPlistFilePath & "\"") as text
074  do shell script strCommandText
075  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:AVGeneral:EnableAV2:1 bool false\" \"" & strPlistFilePath & "\"") as text
076  do shell script strCommandText
077end try
078set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:EnableAV2:0 integer 0\" \"" & strPlistFilePath & "\"") as text
079do shell script strCommandText
080set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:EnableAV2:1 bool false\" \"" & strPlistFilePath & "\"") as text
081do shell script strCommandText
082#######FeatureLockDown:EnableAV2Enterprise FeatureLockdown
083try
084  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:FeatureLockDown:bEnableAV2Enterprise:0\" \"" & strPlistFilePath & "\"") as text
085  set strResponse to (do shell script strCommandText) as text
086on error
087  try
088    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:FeatureLockDown:\" \"" & strPlistFilePath & "\"") as text
089    set strResponse to (do shell script strCommandText) as text
090    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:FeatureLockDown:bEnableAV2Enterprise array\" \"" & strPlistFilePath & "\"") as text
091    do shell script strCommandText
092    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:FeatureLockDown:bEnableAV2Enterprise:0 integer 0\" \"" & strPlistFilePath & "\"") as text
093    do shell script strCommandText
094    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:FeatureLockDown:bEnableAV2Enterprise:1 bool false\" \"" & strPlistFilePath & "\"") as text
095    do shell script strCommandText
096  on error
097    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:FeatureLockDown dict\" \"" & strPlistFilePath & "\"") as text
098    do shell script strCommandText
099    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:FeatureLockDown:bEnableAV2Enterprise array\" \"" & strPlistFilePath & "\"") as text
100    do shell script strCommandText
101    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:FeatureLockDown:bEnableAV2Enterprise:0 integer 0\" \"" & strPlistFilePath & "\"") as text
102    do shell script strCommandText
103    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:FeatureLockDown:bEnableAV2Enterprise:1 bool false\" \"" & strPlistFilePath & "\"") as text
104    do shell script strCommandText
105  end try
106end try
107set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:FeatureLockDown:bEnableAV2Enterprise:0 integer 0\" \"" & strPlistFilePath & "\"") as text
108do shell script strCommandText
109set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:FeatureLockDown:bEnableAV2Enterprise:1 bool false\" \"" & strPlistFilePath & "\"") as text
110do shell script strCommandText
111
112return
113
114
115set strCommandText to ("/usr/libexec/PlistBuddy -c \"Save\" \"" & strPlistFilePath & "\"") as text
116set strResponse to (do shell script strCommandText) as text
117
118
119
120########################################################
121##パス無償版
122set ocidPlistFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/com.adobe.Reader.plist")
123set strPlistFilePathURL to (ocidPlistFilePathURL's |path|()) as text
124
125#########内容の確認
126#IPMEnableAV2ReaderNewUser
127set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:IPMEnableAV2ReaderNewUser:0\" \"" & strPlistFilePathURL & "\"") as text
128set strResponse to (do shell script strCommandText) as text
129log strResponse
130##########IPMEnableAV2ReaderNewUser
131set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:IPMEnableAV2ReaderNewUser:1\" \"" & strPlistFilePathURL & "\"") as text
132set strResponse to (do shell script strCommandText) as text
133if strResponse is "true" then
134  log "IPMEnableAV2ReaderNewUser:現在の設定はYES TRUEです FALSEに変更します"
135  ###値変更
136  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:IPMEnableAV2ReaderNewUser:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
137  set strResponse to (do shell script strCommandText) as text
138else if strResponse is "false" then
139  log "IPMEnableAV2ReaderNewUser:現在の設定はNO FALSEです"
140end if
141
142
143#######EnableAV2 FeatureLockDown
144try
145  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:FeatureLockDown:bEnableAV2:1\" \"" & strPlistFilePathURL & "\"") as text
146  set strResponse to (do shell script strCommandText) as text
147  if strResponse is "true" then
148    log "EnableAV2Enterprise:現在の設定はYES TRUEです FALSEに変更します"
149    ###値変更
150    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:FeatureLockDown:bEnableAV2:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
151    set strResponse to (do shell script strCommandText) as text
152  else if strResponse is "false" then
153    log "EnableAV2Enterprise:現在の設定はNO FALSEです"
154  end if
155on error
156  ###値変更
157  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:FeatureLockDown:bEnableAV2:0 integer 0\" \"" & strPlistFilePathURL & "\"") as text
158  set strResponse to (do shell script strCommandText) as text
159  ###値変更
160  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:FeatureLockDown:bEnableAV2:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
161  set strResponse to (do shell script strCommandText) as text
162end try
163#######EnableAV2 AVGeneral
164try
165  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:EnableAV2:1\" \"" & strPlistFilePathURL & "\"") as text
166  set strResponse to (do shell script strCommandText) as text
167  if strResponse is "true" then
168    log "EnableAV2Enterprise:現在の設定はYES TRUEです FALSEに変更します"
169    ###値変更
170    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:EnableAV2:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
171    set strResponse to (do shell script strCommandText) as text
172  else if strResponse is "false" then
173    log "EnableAV2Enterprise:現在の設定はNO FALSEです"
174  end if
175on error
176  ###値変更
177  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:EnableAV2:0 integer 0\" \"" & strPlistFilePathURL & "\"") as text
178  set strResponse to (do shell script strCommandText) as text
179  ###値変更
180  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:EnableAV2:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
181  set strResponse to (do shell script strCommandText) as text
182end try
183
184
185#######EnableAV2Enterprise FeatureLockDown
186try
187  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:FeatureLockDown:bEnableAV2Enterprise:1\" \"" & strPlistFilePathURL & "\"") as text
188  set strResponse to (do shell script strCommandText) as text
189  if strResponse is "true" then
190    log "EnableAV2Enterprise:現在の設定はYES TRUEです FALSEに変更します"
191    ###値変更
192    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:FeatureLockDown:bEnableAV2Enterprise:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
193    set strResponse to (do shell script strCommandText) as text
194  else if strResponse is "false" then
195    log "EnableAV2Enterprise:現在の設定はNO FALSEです"
196  end if
197on error
198  ###値変更
199  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:FeatureLockDown:bEnableAV2Enterprise:0 integer 0\" \"" & strPlistFilePathURL & "\"") as text
200  set strResponse to (do shell script strCommandText) as text
201  ###値変更
202  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:FeatureLockDown:bEnableAV2Enterprise:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
203  set strResponse to (do shell script strCommandText) as text
204end try
205#######EnableAV2Enterprise AVGeneral
206try
207  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:EnableAV2Enterprise:1\" \"" & strPlistFilePathURL & "\"") as text
208  set strResponse to (do shell script strCommandText) as text
209  if strResponse is "true" then
210    log "EnableAV2Enterprise:現在の設定はYES TRUEです FALSEに変更します"
211    ###値変更
212    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:EnableAV2Enterprise:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
213    set strResponse to (do shell script strCommandText) as text
214  else if strResponse is "false" then
215    log "EnableAV2Enterprise:現在の設定はNO FALSEです"
216  end if
217on error
218  ###値変更
219  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:AVGeneral:EnableAV2Enterprise:0 integer 0\" \"" & strPlistFilePathURL & "\"") as text
220  set strResponse to (do shell script strCommandText) as text
221  ###値変更
222  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:DC:AVGeneral:EnableAV2Enterprise:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
223  set strResponse to (do shell script strCommandText) as text
224end try
225
226set strCommandText to ("/usr/libexec/PlistBuddy -c \"Save\" \"" & strPlistFilePathURL & "\"") as text
227set strResponse to (do shell script strCommandText) as text
228
229
230return
231
232
AppleScriptで生成しました

|

[Acrobat]UIの違いによる処理の分岐 EnableAV2 SDIMode (Single Document Interface)


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#! /usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004#com.cocolog-nifty.quicktimer.icefloe
005----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
006use AppleScript version "2.8"
007use framework "Foundation"
008use framework "AppKit"
009use scripting additions
010property refMe : a reference to current application
011
012##############
013# path to plist
014set appFileManager to refMe's NSFileManager's defaultManager()
015set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
016set ocidLibraryDirPathURL to ocidURLsArray's firstObject()
017set ocidPlistFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/com.adobe.Acrobat.Pro.plist")
018##############
019#  Read Nsdata
020set ocidOption to (refMe's NSDataReadingMappedIfSafe)
021set listReadData to refMe's NSData's alloc()'s initWithContentsOfURL:(ocidPlistFilePathURL) options:(ocidOption) |error| :(reference)
022if (item 2 of listReadData) is (missing value) then
023  set coidReadData to (item 1 of listReadData)
024else
025  log (item 2 of listReadData)'s localizedDescription() as text
026  return " 【NSDATA】失敗しました"
027end if
028##############
029#  conversion to Dict
030set ocidFormat to (refMe's NSPropertyListXMLFormat_v1_0)
031set appSerialization to (refMe's NSPropertyListSerialization)
032set ocidOption to (refMe's NSPropertyListMutableContainersAndLeaves)
033set listPlistDict to appSerialization's propertyListWithData:(coidReadData) options:(ocidOption) format:(ocidFormat) |error| :(reference)
034if (item 2 of listPlistDict) is (missing value) then
035  set ocidPlistDict to (item 1 of listPlistDict)
036else
037  log (item 2 of listPlistDict)'s localizedDescription() as text
038  return "【NSPropertyListSerialization】失敗しました"
039end if
040
041##############
042#  Get Value EnableAV2
043set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.EnableAV2")
044if ocidValueArray = (missing value) then
045  return "AV2設定の無い古いバージョンを利用中です"
046else
047  set ocidTrue to (refMe's NSNumber's numberWithBool:true)
048  set ocidFalse to (refMe's NSNumber's numberWithBool:false)
049  #
050  set ocidBoolValue to (ocidValueArray's objectAtIndex:(1))
051  #
052  if ocidBoolValue = ocidTrue then
053    log "EnableAV2:現在の設定はYES TRUEです"
054    --AV2新UIで起動中
055  else if ocidBoolValue = ocidFalse then
056    log "EnableAV2:現在の設定はNO FALSEです 旧UIを利用中です"
057    --従来形の旧UIで起動中
058  end if
059end if
060
061##############
062# do command EnableAV2
063set strPlistFilePathURL to (ocidPlistFilePathURL's |path|()) as text
064set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:EnableAV2:1\" \"" & strPlistFilePathURL & "\"") as text
065log strCommandText
066try
067  set strBoolValue to (do shell script strCommandText) as text
068  if strBoolValue is "false" then
069    log "EnableAV2:現在の設定はNO FALSEです 旧UIを利用中です"
070    --従来形の旧UIで起動中
071  else if strBoolValue is "true" then
072    log "EnableAV2:現在の設定はYES TRUEです"
073    --AV2新UIで起動中
074  end if
075on error
076  return "AV2設定の無い古いバージョンを利用中です"
077end try
078
079
080
081##############
082#  Get Value SDIMode (Single Document Interface)
083set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.SDIMode")
084if ocidValueArray = (missing value) then
085  return "SDIMode設定の無い古いバージョンを利用中です"
086else
087  set ocidTrue to (refMe's NSNumber's numberWithBool:true)
088  set ocidFalse to (refMe's NSNumber's numberWithBool:false)
089  #
090  set ocidBoolValue to (ocidValueArray's objectAtIndex:(1))
091  #
092  if ocidBoolValue = ocidTrue then
093    log "SDIMode:現在の設定はYES TRUEです"
094    --1ドキュメントに対して1ウィンドウで作業中
095  else if ocidBoolValue = ocidFalse then
096    log "SDIMode:現在の設定はNO FALSEです"
097    --ドキュメントはメインウィンドウにTABとして配置されます
098  end if
099end if
100
101
102##############
103# do command SDIMode
104set strPlistFilePathURL to (ocidPlistFilePathURL's |path|()) as text
105set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:SDIMode:1\" \"" & strPlistFilePathURL & "\"") as text
106log strCommandText
107try
108  set strBoolValue to (do shell script strCommandText) as text
109  if strBoolValue is "false" then
110    log "SDIMode:現在の設定はNO FALSEです 旧UIを利用中です"
111    --ドキュメントはメインウィンドウにTABとして配置されます
112  else if strBoolValue is "true" then
113    log "SDIMode:現在の設定はYES TRUEです"
114    --1ドキュメントに対して1ウィンドウで作業中
115  end if
116on error
117  return "AV2設定の無い古いバージョンを利用中です"
118end try
AppleScriptで生成しました

|

[EnableAV2] アクロバットのUIによって処理を分岐する


サンプルコード

サンプルソース(参考)
行番号ソース
001set strFileName to "MyTestFile.pdf"
002
003#アクロバットがAV2新UIを搭載しているか?確認する
004set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:EnableAV2:1\" \"$HOME/Library/Preferences/com.adobe.Acrobat.Pro.plist\"") as text
005log strCommandText
006try
007  #PlistBuddyコマンド実行
008  set strBoolValue to (do shell script strCommandText) as text
009  log "Av2 New Acrobat UI version (may be after acrobat v22)"
010  #AV2新UIを利用中の場合
011  if strBoolValue is "true" then
012    log "AV2新UIで起動中"
013    #ここにAv2対応の処理を記載
014    tell application "Adobe Acrobat"
015      set numCntDoc to (count of every document) as integer
016      repeat with itemIntNo from 1 to (numCntDoc) by 1
017        tell document itemIntNo
018          set strDocName to name as text
019        end tell
020        if strDocName is strFileName then
021          set strTabNo to (itemIntNo - 1) as text
022          set strTabName to ("SwitchToTab" & strTabNo) as text
023          do script "app.execMenuItem(\"" & strTabName & "\")"
024          exit repeat
025        end if
026      end repeat
027    end tell
028    #旧UIを利用中の場合
029  else if strBoolValue is "false" then
030    log "旧UIで起動中"
031    try
032      tell application "Adobe Acrobat" to bring to front (first document whose name is strFileName)
033    on error
034      log "no such document"
035    end try
036  end if
037on error
038  #初期設定にEnableAV2が無い旧バージョンのUIの機種の処理はこちに記載
039  log "No Av2 New Acrobat UI version (may be before acrobat v21)"
040  try
041    tell application "Adobe Acrobat" to bring to front (first document whose name is strFileName)
042  on error
043    log "no such document"
044  end try
045end try
AppleScriptで生成しました


サンプルコード

サンプルソース(参考)
行番号ソース
001set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:EnableAV2:1\" \"$HOME/Library/Preferences/com.adobe.Acrobat.Pro.plist\"") as text
002log strCommandText
003try
004  set strBoolValue to (do shell script strCommandText) as text
005  log "Av2 New Acrobat UI version (may be after acrobat v22)"
006  -- bring to front is not work
007  if strBoolValue is "false" then
008    log "Using Classic UI"
009  else if strBoolValue is "true" then
010    log "Using NEW AV2UI"
011  end if
012on error
013  log "No Av2 New Acrobat UI version (may be before acrobat v21)"
014  -- bring to front is work
015end try
AppleScriptで生成しました

|

[acrobat] AcrobatのAv2新UI設定を旧UI設定に戻します(bash版)


#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
#AcrobatのAv2新UI設定を旧UI設定に戻します
#################################################
###基本
USER_WHOAMI=$(/usr/bin/whoami)
/bin/echo "実行ユーザー(whoami): $USER_WHOAMI"
###実行しているユーザー名
CONSOLE_USER=$(/bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/ { print $3 }')
/bin/echo "コンソールユーザー(scutil): $CONSOLE_USER"
###実行しているユーザー名
HOME_USER=$(/bin/echo "$HOME" | /usr/bin/awk -F'/' '{print $NF}')
/bin/echo "実行ユーザー(HOME): $HOME_USER"
###logname
LOGIN_NAME=$(/usr/bin/logname)
/bin/echo "ログイン名(logname): $LOGIN_NAME"
###UID
USER_NAME=$(/usr/bin/id -un)
/bin/echo "ユーザー名(id): $USER_NAME"
#################################################
/bin/echo "設定ファイルへのパス まずは製品版から"
STR_PLIST_PATH="$HOME/Library/Preferences/com.adobe.Acrobat.Pro.plist"
###IPMEnableAV2AcrobatNewUser
BOOL_VALUE=$(/usr/libexec/PlistBuddy -c "Print:DC:AVGeneral:IPMEnableAV2AcrobatNewUser:1" "$STR_PLIST_PATH")
/bin/echo "IPMEnableAV2AcrobatNewUser 現在の設定は: $BOOL_VALUE"
if [ "$BOOL_VALUE" = "true" ]; then
##設定をFALSEに
/usr/libexec/PlistBuddy -c "Set:DC:AVGeneral:IPMEnableAV2AcrobatNewUser:1 bool false" "$STR_PLIST_PATH"
/bin/echo "IPMEnableAV2AcrobatNewUser 設定を変更しました"
fi
###EnableAV2
BOOL_VALUE=$(/usr/libexec/PlistBuddy -c "Print:DC:AVGeneral:EnableAV2:1" "$STR_PLIST_PATH")
/bin/echo "EnableAV2 現在の設定は: $BOOL_VALUE"
if [ "$BOOL_VALUE" = "true" ]; then
##設定をFALSEに
/usr/libexec/PlistBuddy -c "Set:DC:AVGeneral:EnableAV2:1 bool false" "$STR_PLIST_PATH"
/bin/echo "EnableAV2 設定を変更しました"
fi
###EnableAV2Enterprise
BOOL_VALUE=$(/usr/libexec/PlistBuddy -c "Print:DC:FeatureLockDown:EnableAV2Enterprise" "$STR_PLIST_PATH")
/bin/echo "EnableAV2Enterprise 現在の設定は: $BOOL_VALUE"
if [ "$BOOL_VALUE" = "true" ]; then
##設定をFALSEに
/usr/libexec/PlistBuddy -c "Set:DC:FeatureLockDown:EnableAV2Enterprise bool false" "$STR_PLIST_PATH"
/bin/echo "EnableAV2Enterprise 設定を変更しました"
fi
##保存
/usr/libexec/PlistBuddy -c "Save" "$STR_PLIST_PATH"

#################################################
/bin/echo "設定ファイルへのパス 無償Reader版"
STR_PLIST_PATH="$HOME/Library/Preferences/com.adobe.Reader.plist"
###IPMEnableAV2ReaderNewUser
BOOL_VALUE=$(/usr/libexec/PlistBuddy -c "Print:DC:AVGeneral:IPMEnableAV2ReaderNewUser:1" "$STR_PLIST_PATH")
/bin/echo "IPMEnableAV2ReaderNewUser 現在の設定は: $BOOL_VALUE"
if [ "$BOOL_VALUE" = "true" ]; then
##設定をFALSEに
/usr/libexec/PlistBuddy -c "Set:DC:AVGeneral:IPMEnableAV2ReaderNewUser:1 bool false" "$STR_PLIST_PATH"
/bin/echo "IPMEnableAV2ReaderNewUser 設定を変更しました"
fi
###EnableAV2
BOOL_VALUE=$(/usr/libexec/PlistBuddy -c "Print:DC:AVGeneral:EnableAV2:1" "$STR_PLIST_PATH")
/bin/echo "EnableAV2 現在の設定は: $BOOL_VALUE"
if [ "$BOOL_VALUE" = "true" ]; then
##設定をFALSEに
/usr/libexec/PlistBuddy -c "Set:DC:AVGeneral:EnableAV2:1 bool false" "$STR_PLIST_PATH"
/bin/echo "EnableAV2 設定を変更しました"
fi
###EnableAV2Enterprise
BOOL_VALUE=$(/usr/libexec/PlistBuddy -c "Print:DC:FeatureLockDown:EnableAV2Enterprise" "$STR_PLIST_PATH")
/bin/echo "EnableAV2Enterprise 現在の設定は: $BOOL_VALUE"
if [ "$BOOL_VALUE" = "true" ]; then
##設定をFALSEに
/usr/libexec/PlistBuddy -c "Set:DC:FeatureLockDown:EnableAV2Enterprise bool false" "$STR_PLIST_PATH"
/bin/echo "EnableAV2Enterprise 設定を変更しました"
fi
##保存
/usr/libexec/PlistBuddy -c "Save" "$STR_PLIST_PATH"

exit 0


|

[Acrobat]Av2新UIの設定をFALSEにする(PlistBuddy版)


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
(*
前提
Adobe Acrobat Acrobat Reader
アプリケーションを終了させてから
10秒程度経過してから
実行してください
*)
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
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 NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidLibraryDirPathURL to ocidURLsArray's firstObject()
########################################################
##PLISTへのパス まずは 製品版
set ocidPlistFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/com.adobe.Acrobat.Pro.plist")
set strPlistFilePathURL to (ocidPlistFilePathURL's |path|()) as text

###内容の確認
#IPMEnableAV2AcrobatNewUser
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:IPMEnableAV2AcrobatNewUser:0\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text
log strResponse
#IPMEnableAV2AcrobatNewUser
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:IPMEnableAV2AcrobatNewUser:1\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text
if strResponse is "true" then
  log "IPMEnableAV2AcrobatNewUser:現在の設定はYES TRUEです FALSEに変更します"
  ###値変更
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:IPMEnableAV2AcrobatNewUser:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
  set strResponse to (do shell script strCommandText) as text
else if strResponse is "false" then
  log "IPMEnableAV2AcrobatNewUser:現在の設定はNO FALSEです"
end if
#EnableAV2
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:EnableAV2:0\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text
log strResponse
#EnableAV2
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:EnableAV2:1\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text
if strResponse is "true" then
  log "EnableAV2:現在の設定はYES TRUEです FALSEに変更します"
  ###値変更
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:EnableAV2:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
  set strResponse to (do shell script strCommandText) as text
else if strResponse is "false" then
  log "EnableAV2:現在の設定はNO FALSEです"
end if

#EnableAV2Enterprise
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:FeatureLockDown:EnableAV2Enterprise\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text
if strResponse is "true" then
  log "EnableAV2Enterprise:現在の設定はYES TRUEです FALSEに変更します"
  ###値変更
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:FeatureLockDown:EnableAV2Enterprise bool false\" \"" & strPlistFilePathURL & "\"") as text
  set strResponse to (do shell script strCommandText) as text
else if strResponse is "false" then
  log "EnableAV2Enterprise:現在の設定はNO FALSEです"
end if

set strCommandText to ("/usr/libexec/PlistBuddy -c \"Save\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text



########################################################
##パス無償版
set ocidPlistFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/com.adobe.Reader.plist")
set strPlistFilePathURL to (ocidPlistFilePathURL's |path|()) as text

###内容の確認
#IPMEnableAV2ReaderNewUser
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:IPMEnableAV2ReaderNewUser:0\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text
log strResponse
#IPMEnableAV2ReaderNewUser
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:IPMEnableAV2ReaderNewUser:1\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text
if strResponse is "true" then
  log "IPMEnableAV2ReaderNewUser:現在の設定はYES TRUEです FALSEに変更します"
  ###値変更
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:IPMEnableAV2ReaderNewUser:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
  set strResponse to (do shell script strCommandText) as text
else if strResponse is "false" then
  log "IPMEnableAV2ReaderNewUser:現在の設定はNO FALSEです"
end if
#EnableAV2
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:EnableAV2:0\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text
log strResponse
#EnableAV2
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:AVGeneral:EnableAV2:1\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text
if strResponse is "true" then
  log "EnableAV2:現在の設定はYES TRUEです FALSEに変更します"
  ###値変更
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:AVGeneral:EnableAV2:1 bool false\" \"" & strPlistFilePathURL & "\"") as text
  set strResponse to (do shell script strCommandText) as text
else if strResponse is "false" then
  log "EnableAV2:現在の設定はNO FALSEです"
end if

#EnableAV2Enterprise
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:DC:FeatureLockDown:EnableAV2Enterprise\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text
if strResponse is "true" then
  log "EnableAV2Enterprise:現在の設定はYES TRUEです FALSEに変更します"
  ###値変更
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:DC:FeatureLockDown:EnableAV2Enterprise bool false\" \"" & strPlistFilePathURL & "\"") as text
  set strResponse to (do shell script strCommandText) as text
else if strResponse is "false" then
  log "EnableAV2Enterprise:現在の設定はNO FALSEです"
end if

set strCommandText to ("/usr/libexec/PlistBuddy -c \"Save\" \"" & strPlistFilePathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text


return




|

[Acrobat]Av2新UIの設定をFALSEにする(修正)


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
(*
前提
Adobe Acrobat Acrobat Reader
アプリケーションを終了させてから
10秒程度経過してから
実行してください
*)
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use framework "UniformTypeIdentifiers"
use scripting additions
property refMe : a reference to current application

set listBundleID to {"com.adobe.Acrobat.Pro", "com.adobe.Reader"} as list

###アプリケーションが起動しているか
set ocidRunningApplication to refMe's NSRunningApplication
repeat with itemBundleID in listBundleID
  set ocidAppArray to (ocidRunningApplication's runningApplicationsWithBundleIdentifier:(itemBundleID))
  set itemAppArray to ocidAppArray's firstObject()
  if itemAppArray is (missing value) then
    log "アプリケーションが起動していませんので処理します"
  else
    display alert "エラー:アプリケーションを終了させてください" buttons {"OK", "キャンセル"} default button "OK" as informational giving up after 2
return "エラー:アプリケーションが起動しています終了させてから実行してください"
  end if
end repeat

###BOOL値比較用
set ocidTrue to (refMe's NSNumber's numberWithBool:true)
set ocidFalse to (refMe's NSNumber's numberWithBool:false)


##パス
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidLibraryDirPathURL to ocidURLsArray's firstObject()
##PLISTへのパス まずは 製品版
set ocidPlistFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/com.adobe.Acrobat.Pro.plist")
log "まずは 製品版の設定変更"
##### ◆IPMEnableAV2AcrobatNewUser
###まずは現在の値 (Acrobat)
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistFilePathURL)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.IPMEnableAV2AcrobatNewUser")
if ocidValueArray = (missing value) then
  set listValue to {0, true} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("IPMEnableAV2AcrobatNewUser")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はYES TRUEです"
  else if ocidValue = ocidFalse then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidTrue)
  end if
end if
##### ◆EnableAV2
###まずは現在の値 (Acrobat)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.EnableAV2")
if ocidValueArray = (missing value) then
  set listValue to {0, true} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("EnableAV2")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "EnableAV2:現在の設定はYES TRUEです"
  else if ocidValue = ocidFalse then
    log "EnableAV2:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidTrue)
  end if
end if
##### ◆EnableAV2Enterprise
###まずは現在の値 (Acrobat)
set ocidValue to ocidPlistDict's valueForKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
if ocidValue = (missing value) then
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidFeatureLockDownDict to ocidPlistDict's objectForKey:("FeatureLockDown")
ocidFeatureLockDownDict's setValue:(ocidTrue) forKey:("EnableAV2Enterprise")
else
  if ocidValue = ocidTrue then
    log "EnableAV2Enterprise:現在の設定はYES TRUEです"
    
  else if ocidValue = ocidFalse then
    log "EnableAV2Enterprise:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidPlistDict's setValue:(ocidTrue) forKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
  end if
end if
##保存
set boolDone to ocidPlistDict's writeToURL:(ocidPlistFilePathURL) atomically:true


###リーダ版の設定パス
set ocidPlistFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/com.adobe.Reader.plist")
log "続いて リーダー無償版の設定変更"

##### ◆IPMEnableAV2AcrobatNewUser
###まずは現在の値 (Acrobat)
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistFilePathURL)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.IPMEnableAV2AcrobatNewUser")
if ocidValueArray = (missing value) then
  set listValue to {0, true} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("IPMEnableAV2AcrobatNewUser")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はYES TRUEです"
    
  else if ocidValue = ocidFalse then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidTrue)
  end if
end if
##### ◆EnableAV2
###まずは現在の値 (Acrobat)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.EnableAV2")
if ocidValueArray = (missing value) then
  set listValue to {0, true} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("EnableAV2")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "EnableAV2:現在の設定はYES TRUEです"
  else if ocidValue = ocidFalse then
    log "EnableAV2:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidTrue)
  end if
end if
##### ◆EnableAV2Enterprise
###まずは現在の値 (Acrobat)
set ocidValue to ocidPlistDict's valueForKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
if ocidValue = (missing value) then
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidFeatureLockDownDict to ocidPlistDict's objectForKey:("FeatureLockDown")
ocidFeatureLockDownDict's setValue:(ocidTrue) forKey:("EnableAV2Enterprise")
else
  if ocidValue = ocidTrue then
    log "EnableAV2Enterprise:現在の設定はYES TRUEです"
  else if ocidValue = ocidFalse then
    log "EnableAV2Enterprise:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidPlistDict's setValue:(ocidTrue) forKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
  end if
end if
##保存
set boolDone to ocidPlistDict's writeToURL:(ocidPlistFilePathURL) atomically:true



|

[Acrobat]AV2新UIを有効にする


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
(*
前提
Adobe Acrobat Acrobat Reader
アプリケーションを終了させてから
10秒程度経過してから
実行してください
*)
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application

###BOOL値比較用
set ocidTrue to (refMe's NSNumber's numberWithBool:true)
set ocidFalse to (refMe's NSNumber's numberWithBool:false)


##パス
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidLibraryDirPathURL to ocidURLsArray's firstObject()
##PLISTへのパス まずは 製品版
set ocidPlistFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/com.adobe.Acrobat.Pro.plist")
log "まずは 製品版の設定変更"
##### ◆IPMEnableAV2AcrobatNewUser
###まずは現在の値 (Acrobat)
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistFilePathURL)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.IPMEnableAV2AcrobatNewUser")
if ocidValueArray = (missing value) then
  set listValue to {0, true} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("IPMEnableAV2AcrobatNewUser")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はYES TRUEです"
  else if ocidValue = ocidFalse then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidTrue)
  end if
end if
##### ◆EnableAV2
###まずは現在の値 (Acrobat)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.EnableAV2")
if ocidValueArray = (missing value) then
  set listValue to {0, true} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("EnableAV2")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "EnableAV2:現在の設定はYES TRUEです"
  else if ocidValue = ocidFalse then
    log "EnableAV2:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidTrue)
  end if
end if
##### ◆EnableAV2Enterprise
###まずは現在の値 (Acrobat)
set ocidValue to ocidPlistDict's valueForKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
if ocidValue = (missing value) then
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidFeatureLockDownDict to ocidPlistDict's objectForKey:("FeatureLockDown")
ocidFeatureLockDownDict's setValue:(ocidTrue) forKey:("EnableAV2Enterprise")
else
  if ocidValue = ocidTrue then
    log "EnableAV2Enterprise:現在の設定はYES TRUEです"
    
  else if ocidValue = ocidFalse then
    log "EnableAV2Enterprise:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidPlistDict's setValue:(ocidTrue) forKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
  end if
end if
##保存
set boolDone to ocidPlistDict's writeToURL:(ocidPlistFilePathURL) atomically:true


###リーダ版の設定パス
set ocidPlistFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/com.adobe.Reader.plist")
log "続いて リーダー無償版の設定変更"

##### ◆IPMEnableAV2AcrobatNewUser
###まずは現在の値 (Acrobat)
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistFilePathURL)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.IPMEnableAV2AcrobatNewUser")
if ocidValueArray = (missing value) then
  set listValue to {0, true} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("IPMEnableAV2AcrobatNewUser")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はYES TRUEです"
    
  else if ocidValue = ocidFalse then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidTrue)
  end if
end if
##### ◆EnableAV2
###まずは現在の値 (Acrobat)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.EnableAV2")
if ocidValueArray = (missing value) then
  set listValue to {0, true} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("EnableAV2")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "EnableAV2:現在の設定はYES TRUEです"
  else if ocidValue = ocidFalse then
    log "EnableAV2:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidTrue)
  end if
end if
##### ◆EnableAV2Enterprise
###まずは現在の値 (Acrobat)
set ocidValue to ocidPlistDict's valueForKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
if ocidValue = (missing value) then
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidFeatureLockDownDict to ocidPlistDict's objectForKey:("FeatureLockDown")
ocidFeatureLockDownDict's setValue:(ocidTrue) forKey:("EnableAV2Enterprise")
else
  if ocidValue = ocidTrue then
    log "EnableAV2Enterprise:現在の設定はYES TRUEです"
  else if ocidValue = ocidFalse then
    log "EnableAV2Enterprise:現在の設定はNO FALSEです TRUEに変更します"
    ###値変更
ocidPlistDict's setValue:(ocidTrue) forKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
  end if
end if
##保存
set boolDone to ocidPlistDict's writeToURL:(ocidPlistFilePathURL) atomically:true



|

[Acrobat]AV2新UIを無効にする


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
(*
前提
Adobe Acrobat Acrobat Reader
アプリケーションを終了させてから
10秒程度経過してから
実行してください
*)
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application

###BOOL値比較用
set ocidTrue to (refMe's NSNumber's numberWithBool:true)
set ocidFalse to (refMe's NSNumber's numberWithBool:false)


##パス
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidLibraryDirPathURL to ocidURLsArray's firstObject()
##PLISTへのパス まずは 製品版
set ocidPlistFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/com.adobe.Acrobat.Pro.plist")
log "まずは 製品版の設定変更"
##### ◆IPMEnableAV2AcrobatNewUser
###まずは現在の値 (Acrobat)
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistFilePathURL)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.IPMEnableAV2AcrobatNewUser")
if ocidValueArray = (missing value) then
  set listValue to {0, false} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("IPMEnableAV2AcrobatNewUser")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はYES TRUEです FALSEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidFalse)
  else if ocidValue = ocidFalse then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はNO FALSEです"
  end if
end if
##### ◆EnableAV2
###まずは現在の値 (Acrobat)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.EnableAV2")
if ocidValueArray = (missing value) then
  set listValue to {0, false} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("EnableAV2")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "EnableAV2:現在の設定はYES TRUEです FALSEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidFalse)
  else if ocidValue = ocidFalse then
    log "EnableAV2:現在の設定はNO FALSEです"
  end if
end if
##### ◆EnableAV2Enterprise
###まずは現在の値 (Acrobat)
set ocidValue to ocidPlistDict's valueForKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
if ocidValue = (missing value) then
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidFeatureLockDownDict to ocidPlistDict's objectForKey:("FeatureLockDown")
ocidFeatureLockDownDict's setValue:(ocidFalse) forKey:("EnableAV2Enterprise")
else
  if ocidValue = ocidTrue then
    log "EnableAV2Enterprise:現在の設定はYES TRUEです FALSEに変更します"
    ###値変更
ocidPlistDict's setValue:(ocidFalse) forKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
  else if ocidValue = ocidFalse then
    log "EnableAV2Enterprise:現在の設定はNO FALSEです"
  end if
end if
##保存
set boolDone to ocidPlistDict's writeToURL:(ocidPlistFilePathURL) atomically:true


###リーダ版の設定パス
set ocidPlistFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/com.adobe.Reader.plist")
log "続いて リーダー無償版の設定変更"

##### ◆IPMEnableAV2AcrobatNewUser
###まずは現在の値 (Acrobat)
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistFilePathURL)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.IPMEnableAV2AcrobatNewUser")
if ocidValueArray = (missing value) then
  set listValue to {0, false} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("IPMEnableAV2AcrobatNewUser")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はYES TRUEです FALSEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidFalse)
  else if ocidValue = ocidFalse then
    log "IPMEnableAV2AcrobatNewUser:現在の設定はNO FALSEです"
  end if
end if
##### ◆EnableAV2
###まずは現在の値 (Acrobat)
set ocidValueArray to (ocidPlistDict's valueForKeyPath:"DC.AVGeneral.EnableAV2")
if ocidValueArray = (missing value) then
  set listValue to {0, false} as list
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidGeneralDict to ocidDcDict's objectForKey:("AVGeneral")
ocidGeneralDict's setValue:(listValue) forKey:("EnableAV2")
else
  set ocidValue to ocidValueArray's objectAtIndex:(1)
  if ocidValue = ocidTrue then
    log "EnableAV2:現在の設定はYES TRUEです FALSEに変更します"
    ###値変更
ocidValueArray's replaceObjectAtIndex:(1) withObject:(ocidFalse)
  else if ocidValue = ocidFalse then
    log "EnableAV2:現在の設定はNO FALSEです"
  end if
end if
##### ◆EnableAV2Enterprise
###まずは現在の値 (Acrobat)
set ocidValue to ocidPlistDict's valueForKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
if ocidValue = (missing value) then
  set ocidDcDict to ocidPlistDict's objectForKey:("DC")
  set ocidFeatureLockDownDict to ocidPlistDict's objectForKey:("FeatureLockDown")
ocidFeatureLockDownDict's setValue:(ocidFalse) forKey:("EnableAV2Enterprise")
else
  if ocidValue = ocidTrue then
    log "EnableAV2Enterprise:現在の設定はYES TRUEです FALSEに変更します"
    ###値変更
ocidPlistDict's setValue:(ocidFalse) forKeyPath:("DC.FeatureLockDown.EnableAV2Enterprise")
  else if ocidValue = ocidFalse then
    log "EnableAV2Enterprise:現在の設定はNO FALSEです"
  end if
end if
##保存
set boolDone to ocidPlistDict's writeToURL:(ocidPlistFilePathURL) atomically:true

|

その他のカテゴリー

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