Acrobat Reader

[Reader]文字バケしたユーザー情報を上書きする


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

#!/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 framework "AppKit"
use scripting additions
property refMe : a reference to current application

##########################################
###設定項目
##メールアドレス
set strEMail to ("foo@hoge.com") as text
##会社名
set strCorporation to ("Self-Employed") as text
##省略形 ローマ字4文字以内推奨
set strCorporationAbbr to ("TK") as text
##姓
set strFirstName to ("寅次郎") as text
##名
set strLastName to ("車") as text
##フルネーム
set strName to ("車寅次郎") as text
##部署
set strDepartment to ("フーテン") as text
##役職
set strTitle to ("さくらの兄") as text
##########################################
###開いている書類
set listFileAlias to {} as list
tell application id "com.adobe.Reader"
  set listEveryDoc to (every document) as list
  repeat with itemDoc in listEveryDoc
    tell itemDoc
      set aliasFilePath to file alias
      set end of listFileAlias to aliasFilePath
    end tell
  end repeat
  if (count of listEveryDoc) > 0 then
    tell active doc
      set strActiveName to name as text
      set aliasActiveFilePath to file alias as alias
    end tell
  end if
end tell

##########################################
###アプリケーションを終了させる
log doQuitApp()
delay 1
##########################################
###本処理
set listAppBundleID to {"com.adobe.Reader", "com.adobe.Acrobat.Pro"} as list
###Plistへのパス
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()
###ReaderとPro両方処理する
repeat with itemPlistFileName in listAppBundleID
log itemPlistFileName
  ##########################################
  ###【1】PLISTのパス
  set strSubPath to ("Preferences/" & itemPlistFileName) as text
  set ocidBaseFilePathURL to (ocidLibraryDirPathURL's URLByAppendingPathComponent:(strSubPath) isDirectory:(false))
  set ocidPlistFilePathURL to (ocidBaseFilePathURL's URLByAppendingPathExtension:("plist"))
  ##########################################
  ### 【2】PLISTを可変レコードとして読み込み
  set ocidPlistDict to (refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistFilePathURL))
  ##########################################
  ### 【3】処理
  set ocidDCDict to (ocidPlistDict's objectForKey:("DC"))
  set ocidIdentityDict to (ocidDCDict's objectForKey:("Identity"))
  ##判定用に値をリストで取得
  set ocidAllValue to ocidIdentityDict's allValues()
  ##値をテキストにして
  set strValueJoinText to (ocidAllValue's componentsJoinedByString:(" ")) as text
  ##判定させる(使ってないけど)
  if strValueJoinText contains "?" then
log "文字化けの可能性が高いです"
  else
log "たぶん文字化けしていません"
  end if
  #
  set ocidEMailArray to (ocidIdentityDict's objectForKey:("EMail"))
(ocidEMailArray's replaceObjectAtIndex:(1) withObject:(strEMail))
  #
  set ocidCorporationArray to (ocidIdentityDict's objectForKey:("Corporation"))
(ocidCorporationArray's replaceObjectAtIndex:(1) withObject:(strCorporation))
  #
  set ocidCorporationAbbrArray to (ocidIdentityDict's objectForKey:("CorporationAbbr"))
(ocidCorporationAbbrArray's replaceObjectAtIndex:(1) withObject:(strCorporationAbbr))
  #
  set ocidFirstNameArray to (ocidIdentityDict's objectForKey:("FirstName"))
(ocidFirstNameArray's replaceObjectAtIndex:(1) withObject:(strFirstName))
  #
  set ocidLastNameArray to (ocidIdentityDict's objectForKey:("LastName"))
(ocidLastNameArray's replaceObjectAtIndex:(1) withObject:(strLastName))
  #
  set ocidNameArray to (ocidIdentityDict's objectForKey:("Name"))
(ocidNameArray's replaceObjectAtIndex:(1) withObject:(strName))
  #
  set ocidDepartmentArray to (ocidIdentityDict's objectForKey:("Department"))
(ocidDepartmentArray's replaceObjectAtIndex:(1) withObject:(strDepartment))
  #
  set ocidTitleArray to (ocidIdentityDict's objectForKey:("Title"))
(ocidTitleArray's replaceObjectAtIndex:(1) withObject:(strTitle))
  ##########################################
  ####【4】保存 ここは上書き
  set boolDone to (ocidPlistDict's writeToURL:(ocidPlistFilePathURL) atomically:true)
log boolDone
  if boolDone = true then
log "正常終了"
  else
return "保存に失敗しました"
  end if
end repeat

delay 1

##########################################
###開いている書類
if (count of listFileAlias) ≠ 0 then
  tell application id "com.adobe.Reader" to activate
  
  tell application id "com.adobe.Reader"
open listFileAlias
delay 2
    repeat with itemDoc in (every document)
      tell itemDoc
        set strItemName to name as text
      end tell
      if strItemName is strActiveName then
        tell itemDoc
activate
        end tell
      end if
    end repeat
  end tell
  
else
  tell application id "com.adobe.Reader" to activate
end if


return
repeat with itemDoc in (every document)
  if itemDoc is strActiveName then
    tell document strActiveName
activate
    end tell
  end if
end repeat
set listFileAlias to {} as list
tell application id "com.adobe.Reader"
  set listEveryDoc to (every document) as list
  repeat with itemDoc in listEveryDoc
    tell itemDoc
      set aliasFilePath to file alias
      set end of listFileAlias to aliasFilePath
    end tell
  end repeat
  if (count of listEveryDoc) > 0 then
    tell active doc
      set strActiveName to name as text
      set aliasActiveFilePath to file alias as alias
    end tell
  end if
end tell

log listFileAlias
tell application id "com.adobe.Reader"
  set listEveryDoc to (every document) as list
  tell front document
    set aliasFilePath to file alias
  end tell
  tell active doc
    set strActiveName to name as text
    set aliasActiveFilePath to file alias as alias
  end tell
end tell




##########################################
####アプリケーションを終了させる

to doQuitApp()
  
  set listAppBundleID to {"com.adobe.Reader", "com.adobe.Acrobat.Pro"} as list
  
  repeat with itemAppBunleID in listAppBundleID
    tell application id itemAppBunleID to quit
  end repeat
  
  
  
  set listBundleID to {"com.Adobe.Installers.AdobeLogCollectorTool", "com.Adobe.UnifiedPluginInstallerAgent", "com.adobe.ACCC.Uninstaller", "com.adobe.ARMDC", "com.adobe.ARMDCHelper", "com.adobe.AcroLicApp", "com.adobe.Acrobat.NativeMessagingHost", "com.adobe.Acrobat.Pro", "com.adobe.Acrobat.Uninstaller", "com.adobe.AdobeAcroCEF", "com.adobe.AdobeAcroCEFHelper", "com.adobe.AdobeAcroCEFHelperGPU", "com.adobe.AdobeAcroCEFHelperRenderer", "com.adobe.AdobeAcroRdrCEFHelperGPU", "com.adobe.AdobeAcroRdrCEFHelperRenderer", "com.adobe.AdobeApplicationUpdater", "com.adobe.AdobeCRDaemon", "com.adobe.AdobeIPCBroker", "com.adobe.AdobeRNAWebInstaller", "com.adobe.AdobeRdrCEF", "com.adobe.AdobeRdrCEFHelper", "com.adobe.AdobeRdrCEFHelperGPU", "com.adobe.AdobeRdrCEFHelperRenderer", "com.adobe.AdobeResourceSynchronizer", "com.adobe.Automator.Save-as-Adobe-PDF", "com.adobe.CCLibrary", "com.adobe.CCXProcess", "com.adobe.Creative-Cloud-Desktop-App", "com.adobe.HDInstall", "com.adobe.HDUninstaller", "com.adobe.ImporterREDServer.application", "com.adobe.Install", "com.adobe.LogTransport.LogTransport", "com.adobe.Reader", "com.adobe.Reader.helper", "com.adobe.acc.AdobeCreativeCloud", "com.adobe.acc.AdobeDesktopService", "com.adobe.acc.CCDContainer", "com.adobe.acc.HEXHelper", "com.adobe.acc.HEXHelper.GPU", "com.adobe.acc.HEXHelper.Renderer", "com.adobe.acc.installer.v2", "com.adobe.accmac", "com.adobe.accmac.ACCFinderSync", "com.adobe.acrobat.assert", "com.adobe.adobe_licutil", "com.adobe.bridge14", "com.adobe.cc.Adobe-Creative-Cloud-Diagnostics", "com.adobe.ccd.helper", "com.adobe.ccd.troubleshooter", "com.adobe.cep.CEPHtmlEngine", "com.adobe.cep.CEPHtmlEngine Helper", "com.adobe.cep.CEPHtmlEngine Helper (GPU)", "com.adobe.cep.CEPHtmlEngine Helper (Plugin)", "com.adobe.cep.CEPHtmlEngine Helper (Renderer)", "com.adobe.crashreporter", "com.adobe.distiller", "com.adobe.dynamiclinkmanager.application", "com.adobe.dynamiclinkmediaserver.application", "com.adobe.headlights.HLCrashProcessorApp", "com.adobe.headlights.LogTransport2App", "com.adobe.ngl.p7helper", "com.adobe.photodownloader", "com.apple.appkit.xpc.openAndSavePanelService"} as list
  
  
  repeat with itemBundleID in listBundleID
    set strBundleID to itemBundleID as text
    try
      set ocidResultsArray to (refMe's NSRunningApplication's runningApplicationsWithBundleIdentifier:(strBundleID))
      set numCntArray to ocidResultsArray count
      set ocidRunApp to (ocidResultsArray's objectAtIndex:0)
      ###通常終了
      set boolDone to ocidRunApp's terminate()
      ####強制終了
      set boolDone to ocidRunApp's forceTerminate()
    end try
  end repeat
  
  
end doQuitApp

|

Adobe Reader ダウンロードURLリスト(v24)

V24バージョン
バージョンURLLINK
12400220687https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/2400220687/AcroRdrDC_2400220687_MUI.dmgLINK
22400120643https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/2400120643/AcroRdrDC_2400120643_MUI.dmgLINK
32400120615https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2400120615/AcroRdrDC_2400120615_MUI.dmgLINK
42400120604https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2400120604/AcroRdrDC_2400120604_MUI.dmgLINK
項目数 : 4

|

[Adobe Reader]『画像として印刷』のチェックが外れなくなるのを戻す(AS版)


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

#!/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 framework "AppKit"
use scripting additions
property refMe : a reference to current application


##########################################
###アプリケーションの終了
set listBundleID to {"com.adobe.Acrobat.Pro", "com.adobe.Reader"} as list
repeat with itemList in listBundleID
  tell application id itemList to quit
delay 1
end repeat

##########################################
###本処理
set listPlistFileName to {"com.adobe.Acrobat.Pro.plist", "com.adobe.Reader.plist"} as list
###Plistへのパス
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()
###ReaderとPro両方処理する
repeat with itemPlistFileName in listPlistFileName
log "Start:" & itemPlistFileName
  ##########################################
  ###【1】PLISTのパス
  set strSubPath to ("Preferences/" & itemPlistFileName) as text
  set ocidPlistFilePathURL to (ocidLibraryDirPathURL's URLByAppendingPathComponent:(strSubPath) isDirectory:(false))
  ##########################################
  ### 【2】PLISTを可変レコードとして読み込み
  set ocidPlistDict to (refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistFilePathURL))
  ##########################################
  ### 【3】処理
  set ocidDCDict to (ocidPlistDict's objectForKey:("DC"))
  ##############
  set ocidGeneralDict to (ocidDCDict's objectForKey:("General"))
  if ocidGeneralDict = (missing value) then
    set ocidNilDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidDCDict's setObject:(ocidNilDict) forKey:"General")
    set ocidGeneralDict to (ocidDCDict's objectForKey:("General"))
  end if
  #
  set ocidPrintAsImageArray to (ocidGeneralDict's objectForKey:("PrintAsImage"))
  if ocidPrintAsImageArray = (missing value) then
    set ocidNilArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:(0))
(ocidGeneralDict's setObject:(ocidNilArray) forKey:"PrintAsImage")
    set ocidPrintAsImageArray to (ocidGeneralDict's objectForKey:("PrintAsImage"))
  end if
  set listSetValue to {(0 as integer), (false as boolean)} as list
(ocidPrintAsImageArray's setArray:(listSetValue))
  ##############
  set ocidAVGeneralDict to (ocidDCDict's objectForKey:("AVGeneral"))
  if ocidAVGeneralDict = (missing value) then
    set ocidNilDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidDCDict's setObject:(ocidNilDict) forKey:"General")
    set ocidAVGeneralDict to (ocidDCDict's objectForKey:("General"))
  end if
  #
  set ocidAVPrintAsImageArray to (ocidAVGeneralDict's objectForKey:("PrintAsImage"))
  if ocidAVPrintAsImageArray = (missing value) then
    set ocidNilArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:(0))
(ocidAVGeneralDict's setObject:(ocidNilArray) forKey:"PrintAsImage")
    set ocidAVPrintAsImageArray to (ocidAVGeneralDict's objectForKey:("PrintAsImage"))
  end if
  set listSetValue to {(0 as integer), (false as boolean)} as list
(ocidAVPrintAsImageArray's setArray:(listSetValue))
  ##############
  set ocidConversionToPDFDict to (ocidDCDict's objectForKey:("ConversionToPDF"))
  if ocidConversionToPDFDict = (missing value) then
    set ocidNilDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidDCDict's setObject:(ocidNilDict) forKey:"ConversionToPDF")
    set ocidConversionToPDFDict to (ocidDCDict's objectForKey:("ConversionToPDF"))
  end if
  set ocidSettingsArray to (ocidConversionToPDFDict's objectForKey:("Settings"))
  
  if ocidSettingsArray = (missing value) then
    set ocidNilArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:(0))
(ocidConversionToPDFDict's setObject:(ocidNilArray) forKey:"Settings")
    set ocidSettingsArray to (ocidConversionToPDFDict's objectForKey:("Settings"))
  end if
  
  set numCntArray to (count of ocidSettingsArray) as integer
  if numCntArray = 2 then
(ocidSettingsArray's replaceObjectAtIndex:(0) withObject:(8 as integer))
    set ocidItem1Dict to (ocidSettingsArray's objectAtIndex:(1))
    set ocidPrintAsImageArray to (ocidItem1Dict's objectForKey:("PrintAsImage"))
    set listSetValue to {(0 as integer), (false as boolean)} as list
(ocidPrintAsImageArray's setArray:(listSetValue))
    
  else if numCntArray = 0 then
(ocidSettingsArray's insertObject:(8) atIndex:(0))
    set ocidNilDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
    set ocidNilArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:(0))
    set listSetValue to {(0 as integer), (false as boolean)} as list
(ocidNilArray's setArray:(listSetValue))
(ocidNilDict's setObject:(ocidNilArray) forKey:"PrintAsImage")
(ocidSettingsArray's insertObject:(ocidNilDict) atIndex:(1))
  end if
  ##############
  if itemPlistFileName is ("com.adobe.Reader.plist") then
    set ocidAVConversionToPDFDict to (ocidDCDict's objectForKey:("AVConversionToPDF"))
    if ocidAVConversionToPDFDict = (missing value) then
      set ocidNilDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidAVConversionToPDFDict's setObject:(ocidNilDict) forKey:"ConversionToPDF")
      set ocidAVConversionToPDFDict to (ocidAVConversionToPDFDict's objectForKey:("ConversionToPDF"))
    end if
    set ocidAVSettingsArray to (ocidAVConversionToPDFDict's objectForKey:("Settings"))
    if ocidAVSettingsArray = (missing value) then
      set ocidNilArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:(0))
(ocidAVConversionToPDFDict's setObject:(ocidNilArray) forKey:"Settings")
      set ocidAVSettingsArray to (ocidAVConversionToPDFDict's objectForKey:("Settings"))
    end if
(ocidAVSettingsArray's insertObject:(8 as integer) atIndex:(0))
    set ocidAVItemsDict to (ocidAVSettingsArray's objectAtIndex:(1))
    if ocidAVItemsDict = (missing value) then
      set ocidNilDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
      set ocidNilArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:(0))
      set listSetValue to {(0 as integer), (false as boolean)} as list
(ocidNilArray's setArray:(listSetValue))
(ocidNilDict's setObject:(ocidNilArray) forKey:"PrintAsImage")
(ocidAVSettingsArray's insertObject:(ocidNilDict) atIndex:(1))
    else
      set ocidIAVtem1Array to (ocidAVItemsDict's objdectForKey:("PrintAsImage"))
      set listSetValue to {(0 as integer), (false as boolean)} as list
(ocidIAVtem1Array's setArray:(listSetValue))
    end if
  end if
  ##########################################
  ####【4】保存 ここは上書き
  set listDone to (ocidPlistDict's writeToURL:(ocidPlistFilePathURL) |error|:(reference))
  if (item 1 of listDone) = true then
log "正常終了"
  else
return "保存に失敗しました"
  end if
end repeat





|

[Adobe Reader]『画像として印刷』のチェックが外れなくなるのを戻す(bash版)


#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
################################################
###実行しているユーザー名
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"
###STAT
STAT_USR=$(/usr/bin/stat -f%Su /dev/console)
/bin/echo "STAT_USR(console): $STAT_USR"
################################################
#
STR_PLIST_FILEPAHT="$HOME/Library/Preferences/com.adobe.Reader.plist"
################################Classic設定
##General
INT_CLASSNO=$(/usr/libexec/PlistBuddy -c "Print:DC:General:PrintAsImage:0" "$STR_PLIST_FILEPAHT")
if [ $? -ne 0 ]; then
/bin/echo "General未設定"
/usr/libexec/PlistBuddy -c "Add:DC:General:PrintAsImage array" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:General:PrintAsImage:0 integer 0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:General:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
elif [ "$INT_CLASSNO" -eq 0 ]; then
/bin/echo "設定値0=boolで正しいです"
/usr/libexec/PlistBuddy -c "Delete:DC:General:PrintAsImage:1" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:General:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
else
/bin/echo "設定値が" "$INT_CLASSNO" "なので0を設定します"
/usr/libexec/PlistBuddy -c "Delete:DC:General:PrintAsImage:0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Delete:DC:General:PrintAsImage:1" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:General:PrintAsImage:0 integer 0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:General:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
fi
/usr/libexec/PlistBuddy -c "Save" "$STR_PLIST_FILEPAHT"
################################AV2設定
##AVGeneral
INT_CLASSNO=$(/usr/libexec/PlistBuddy -c "Print:DC:AVGeneral:PrintAsImage:0" "$STR_PLIST_FILEPAHT")
if [ $? -ne 0 ]; then
/bin/echo "General未設定"
/usr/libexec/PlistBuddy -c "Add:DC:AVGeneral:PrintAsImage array" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:AVGeneral:PrintAsImage:0 integer 0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:AVGeneral:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
elif [ "$INT_CLASSNO" -eq 0 ]; then
/bin/echo "設定値0=boolで正しいです"
/usr/libexec/PlistBuddy -c "Delete:DC:AVGeneral:PrintAsImage:1" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:AVGeneral:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
else
/bin/echo "設定値が" "$INT_CLASSNO" "なので0を設定します"
/usr/libexec/PlistBuddy -c "Delete:DC:AVGeneral:PrintAsImage:0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Delete:DC:AVGeneral:PrintAsImage:1" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:AVGeneral:PrintAsImage:0 integer 0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:AVGeneral:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
fi
/usr/libexec/PlistBuddy -c "Save" "$STR_PLIST_FILEPAHT"

exit 0
##ここまで ConversionToPDF と AVConversionToPDFは処理しない
################################Classic設定
##ConversionToPDF
INT_CLASSNO=$(/usr/libexec/PlistBuddy -c "Print:DC:ConversionToPDF:Settings:1:PrintAsImage:0" "$STR_PLIST_FILEPAHT")
if [ $? -ne 0 ]; then
/bin/echo "General未設定"
/usr/libexec/PlistBuddy -c "Add:DC:ConversionToPDF:Settings:1:PrintAsImage:0 array " "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:ConversionToPDF:Settings:1:PrintAsImage:0 integer 0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:ConversionToPDF:Settings:1:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
elif [ "$INT_CLASSNO" -eq 0 ]; then
/bin/echo "設定値0=boolで正しいです"
/usr/libexec/PlistBuddy -c "Delete:DC:ConversionToPDF:Settings:1:PrintAsImage:1" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:ConversionToPDF:Settings:1:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
else
/bin/echo "設定値が" "$INT_CLASSNO" "なので0を設定します"
/usr/libexec/PlistBuddy -c "Delete:DC:ConversionToPDF:Settings:1:PrintAsImage:0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Delete:DC:ConversionToPDF:Settings:1:PrintAsImage:1" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:ConversionToPDF:Settings:1:PrintAsImage:0 integer 0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:ConversionToPDF:Settings:1:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
fi
/usr/libexec/PlistBuddy -c "Save" "$STR_PLIST_FILEPAHT"



################################AV2設定
##AVConversionToPDF
INT_CLASSNO=$(/usr/libexec/PlistBuddy -c "Print:DC:AVConversionToPDF:Settings:1:PrintAsImage:0" "$STR_PLIST_FILEPAHT")
if [ $? -ne 0 ]; then
/bin/echo "General未設定"
/usr/libexec/PlistBuddy -c "Add:DC:AVConversionToPDF:Settings:1:PrintAsImage:0 array " "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:AVConversionToPDF:Settings:1:PrintAsImage:0 integer 0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:AVConversionToPDF:Settings:1:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
elif [ "$INT_CLASSNO" -eq 0 ]; then
/bin/echo "設定値0=boolで正しいです"
/usr/libexec/PlistBuddy -c "Delete:DC:AVConversionToPDF:Settings:1:PrintAsImage:1" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:AVConversionToPDF:Settings:1:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
else
/bin/echo "設定値が" "$INT_CLASSNO" "なので0を設定します"
/usr/libexec/PlistBuddy -c "Delete:DC:AVConversionToPDF:Settings:1:PrintAsImage:0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Delete:DC:AVConversionToPDF:Settings:1:PrintAsImage:1" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:AVConversionToPDF:Settings:1:PrintAsImage:0 integer 0" "$STR_PLIST_FILEPAHT"
/usr/libexec/PlistBuddy -c "Add:DC:AVConversionToPDF:Settings:1:PrintAsImage:1 bool false" "$STR_PLIST_FILEPAHT"
fi
/usr/libexec/PlistBuddy -c "Save" "$STR_PLIST_FILEPAHT"

exit 0


|

Adobe ReaderURL LIST 上部が古いバージョン 下部が新しいバージョン

Adobe Reader ダウンロードURL
バージョンURLリンク
11500720033https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1500720033/AcroRdrDC_1500720033_MUI.dmgLINK
21500820082https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1500820082/AcroRdrDC_1500820082_MUI.dmgLINK
31500920069https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1500920069/AcroRdrDC_1500920069_MUI.dmgLINK
41500920071https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1500920071/AcroRdrDC_1500920071_MUI.dmgLINK
51500920077https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1500920077/AcroRdrDC_1500920077_MUI.dmgLINK
61500920079https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1500920079/AcroRdrDC_1500920079_MUI.dmgLINK
71501020056https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1501020056/AcroRdrDC_1501020056_MUI.dmgLINK
81501020059https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1501020059/AcroRdrDC_1501020059_MUI.dmgLINK
91501020060https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1501020060/AcroRdrDC_1501020060_MUI.dmgLINK
101501620039https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1501620039/AcroRdrDC_1501620039_MUI.dmgLINK
111501620041https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1501620041/AcroRdrDC_1501620041_MUI.dmgLINK
121501620045https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1501620045/AcroRdrDC_1501620045_MUI.dmgLINK
131501720050https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1501720050/AcroRdrDC_1501720050_MUI.dmgLINK
141501720053https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1501720053/AcroRdrDC_1501720053_MUI.dmgLINK
151502020039https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1502020039/AcroRdrDC_1502020039_MUI.dmgLINK
161502020042https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1502020042/AcroRdrDC_1502020042_MUI.dmgLINK
171502320053https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1502320053/AcroRdrDC_1502320053_MUI.dmgLINK
181502320056https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1502320056/AcroRdrDC_1502320056_MUI.dmgLINK
191502320070https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1502320070/AcroRdrDC_1502320070_MUI.dmgLINK
201700920044https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1700920044/AcroRdrDC_1700920044_MUI.dmgLINK
211700920058https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1700920058/AcroRdrDC_1700920058_MUI.dmgLINK
221701220093https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1701220093/AcroRdrDC_1701220093_MUI.dmgLINK
231701220095https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1701220095/AcroRdrDC_1701220095_MUI.dmgLINK
241701220098https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1701220098/AcroRdrDC_1701220098_MUI.dmgLINK
251800920044https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1800920044/AcroRdrDC_1800920044_MUI.dmgLINK
261800920050https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1800920050/AcroRdrDC_1800920050_MUI.dmgLINK
271801120036https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1801120036/AcroRdrDC_1801120036_MUI.dmgLINK
281801120038https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1801120038/AcroRdrDC_1801120038_MUI.dmgLINK
291801120040https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1801120040/AcroRdrDC_1801120040_MUI.dmgLINK
301801120055https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1801120055/AcroRdrDC_1801120055_MUI.dmgLINK
311801120058https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1801120058/AcroRdrDC_1801120058_MUI.dmgLINK
321801120063https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1801120063/AcroRdrDC_1801120063_MUI.dmgLINK
331900820071https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1900820071/AcroRdrDC_1900820071_MUI.dmgLINK
341900820074https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1900820074/AcroRdrDC_1900820074_MUI.dmgLINK
351900820080https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1900820080/AcroRdrDC_1900820080_MUI.dmgLINK
361900820081https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1900820081/AcroRdrDC_1900820081_MUI.dmgLINK
371901020064https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1901020064/AcroRdrDC_1901020064_MUI.dmgLINK
381901020069https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1901020069/AcroRdrDC_1901020069_MUI.dmgLINK
391901020091https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1901020091/AcroRdrDC_1901020091_MUI.dmgLINK
401901020098https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1901020098/AcroRdrDC_1901020098_MUI.dmgLINK
411901020099https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1901020099/AcroRdrDC_1901020099_MUI.dmgLINK
421901020100https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1901020100/AcroRdrDC_1901020100_MUI.dmgLINK
431901220034https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1901220034/AcroRdrDC_1901220034_MUI.dmgLINK
441901220035https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1901220035/AcroRdrDC_1901220035_MUI.dmgLINK
451901220036https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1901220036/AcroRdrDC_1901220036_MUI.dmgLINK
461901220040https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1901220040/AcroRdrDC_1901220040_MUI.dmgLINK
471902120047https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1902120047/AcroRdrDC_1902120047_MUI.dmgLINK
481902120048https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1902120048/AcroRdrDC_1902120048_MUI.dmgLINK
491902120049https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1902120049/AcroRdrDC_1902120049_MUI.dmgLINK
501902120056https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1902120056/AcroRdrDC_1902120056_MUI.dmgLINK
511902120058https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1902120058/AcroRdrDC_1902120058_MUI.dmgLINK
521902120061https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/1902120061/AcroRdrDC_1902120061_MUI.dmgLINK
532000130002http://ardownload.adobe.com/pub/adobe/reader/mac/Acrobat2020/2000130002/AcroRdr2020_2000130002_MUI.dmgLINK
542000130005http://ardownload.adobe.com/pub/adobe/reader/mac/Acrobat2020/2000130005/AcroRdr2020_2000130005_MUI.dmgLINK
552000130010http://ardownload.adobe.com/pub/adobe/reader/mac/Acrobat2020/2000130010/AcroRdr2020_2000130010_MUI.dmgLINK
562000620034https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2000620034/AcroRdrDC_2000620034_MUI.dmgLINK
572000620042https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2000620042/AcroRdrDC_2000620042_MUI.dmgLINK
582000920063https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2000920063/AcroRdrDC_2000920063_MUI.dmgLINK
592000920065https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2000920065/AcroRdrDC_2000920065_MUI.dmgLINK
602000920067https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2000920067/AcroRdrDC_2000920067_MUI.dmgLINK
612000920074https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2000920074/AcroRdrDC_2000920074_MUI.dmgLINK
622001220041https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2001220041/AcroRdrDC_2001220041_MUI.dmgLINK
632001220043https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2001220043/AcroRdrDC_2001220043_MUI.dmgLINK
642001220048https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2001220048/AcroRdrDC_2001220048_MUI.dmgLINK
652001320064https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2001320064/AcroRdrDC_2001320064_MUI.dmgLINK
662001320066https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2001320066/AcroRdrDC_2001320066_MUI.dmgLINK
672001320074https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2001320074/AcroRdrDC_2001320074_MUI.dmgLINK
682100120135https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100120135/AcroRdrDC_2100120135_MUI.dmgLINK
692100120138https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100120138/AcroRdrDC_2100120138_MUI.dmgLINK
702100120140https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100120140/AcroRdrDC_2100120140_MUI.dmgLINK
712100120142https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100120142/AcroRdrDC_2100120142_MUI.dmgLINK
722100120145https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100120145/AcroRdrDC_2100120145_MUI.dmgLINK
732100120155https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100120155/AcroRdrDC_2100120155_MUI.dmgLINK
742100520048https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100520048/AcroRdrDC_2100520048_MUI.dmgLINK
752100520054https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100520054/AcroRdrDC_2100520054_MUI.dmgLINK
762100520058https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100520058/AcroRdrDC_2100520058_MUI.dmgLINK
772100520060https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100520060/AcroRdrDC_2100520060_MUI.dmgLINK
782100720091https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100720091/AcroRdrDC_2100720091_MUI.dmgLINK
792100720095https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100720095/AcroRdrDC_2100720095_MUI.dmgLINK
802100720099https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2100720099/AcroRdrDC_2100720099_MUI.dmgLINK
812101120039https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2101120039/AcroRdrDC_2101120039_MUI.dmgLINK
822200120085https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200120085/AcroRdrDC_2200120085_MUI.dmgLINK
832200120117https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200120117/AcroRdrDC_2200120117_MUI.dmgLINK
842200120142https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200120142/AcroRdrDC_2200120142_MUI.dmgLINK
852200120169https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200120169/AcroRdrDC_2200120169_MUI.dmgLINK
862200220191https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200220191/AcroRdrDC_2200220191_MUI.dmgLINK
872200220212https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200220212/AcroRdrDC_2200220212_MUI.dmgLINK
882200320258https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200320258/AcroRdrDC_2200320258_MUI.dmgLINK
892200320263https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200320263/AcroRdrDC_2200320263_MUI.dmgLINK
902200320282https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200320282/AcroRdrDC_2200320282_MUI.dmgLINK
912200320310https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200320310/AcroRdrDC_2200320310_MUI.dmgLINK
922200320314https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200320314/AcroRdrDC_2200320314_MUI.dmgLINK
932200320322https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200320322/AcroRdrDC_2200320322_MUI.dmgLINK
942300120093https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300120093/AcroRdrDC_2300120093_MUI.dmgLINK
952300120143https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300120143/AcroRdrDC_2300120143_MUI.dmgLINK
962300320201https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300320201/AcroRdrDC_2300320201_MUI.dmgLINK
972300320215https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300320215/AcroRdrDC_2300320215_MUI.dmgLINK
982300320244https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300320244/AcroRdrDC_2300320244_MUI.dmgLINK
992300320269https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300320269/AcroRdrDC_2300320269_MUI.dmgLINK
1002300320284https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300320284/AcroRdrDC_2300320284_MUI.dmgLINK
1012300620320https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300620320/AcroRdrDC_2300620320_MUI.dmgLINK
1022300620360https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300620360/AcroRdrDC_2300620360_MUI.dmgLINK
1032300620380https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300620380/AcroRdrDC_2300620380_MUI.dmgLINK
1042300820458https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300820458/AcroRdrDC_2300820458_MUI.dmgLINK
1052300820470https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300820470/AcroRdrDC_2300820470_MUI.dmgLINK
1062300820533https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300820533/AcroRdrDC_2300820533_MUI.dmgLINK
1072300820555https://ardownload3.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300820555/AcroRdrDC_2300820555_MUI.dmgLINK
項目数 : 108

|

[Acrobat Reader]テキスト注釈の作成者の氏名変更(文字化け対策入り)


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

#!/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 framework "AppKit"
#use framework "Quartz"
#use framework "PDFKit"
#use framework "QuartzCore"
#use framework "CoreGraphics"
use scripting additions
property refMe : a reference to current application
set appFileManager to refMe's NSFileManager's defaultManager()

set strBundleID to ("com.adobe.Reader") as text

##################################
#### 文書を開いているか?
##################################
tell application id "com.adobe.Reader"
activate
  tell active doc
    set numAllPage to do script ("this.numPages;")
    set numNowPage to do script ("this.pageNum;")
    try
      if numAllPage is "undefined" then
        error number -1708
      end if
    on error
display alert "エラー:文書が選択されていません" buttons {"OK", "キャンセル"} default button "OK" as informational giving up after 10
return "エラー:文書が選択されていません"
    end try
  end tell
end tell
##################################
#### 注釈を選択しているか?
##################################
tell application id "com.adobe.Reader"
  ####ページ今のページ番号
  set numNowPage to do script ("this.pageNum;")
  tell page numNowPage
    try
      #### selectedAnnotsがエラーしたら選択していない
      set theSelectedAnnots to do script ("this.selectedAnnots;")
      if theSelectedAnnots is "undefined" then
        error number -1708
      end if
      set numLenge to do script ("this.selectedAnnots.length;")
    on error
display alert "エラー:注釈が選択されていません" buttons {"OK", "キャンセル"} default button "OK" as informational giving up after 30
return "エラー:注釈が選択されていません"
    end try
  end tell
end tell
##########################################
#### ユーザー情報取得
##########################################
tell application id "com.adobe.Reader"
launch
activate
  set objActivDoc to active doc
  try
    #### アクロバットの設定から氏名を取得する場合
    set strUserLastNamet to do script ("identity.lastName;") as text
    set strUserFirstNamet to do script ("identity.firstName;") as text
    #### 姓名を繋げて
    set strIdentityName to (strUserLastNamet & strUserFirstNamet) as text
    if strIdentityName is "" then
      set strIdentityName to "" as text
log "環境設定>>ユーザー情報が登録されていません"
    else if strIdentityName starts with "?" then
      set strIdentityName to "" as text
log "環境設定>>ユーザー情報が文字バケしています"
    end if
  on error
    set strIdentityName to "" as text
log "環境設定>>ユーザー情報が登録されていません"
  end try
end tell
##########################################
####ダイアログ
##########################################
set ocidAppPathURL to doGetBundleID2AppURL(strBundleID)
####ダイアログに指定アプリのアイコンを表示する
set strIconPath to ""
###アイコン名をPLISTから取得
set ocidPlistPathURL to ocidAppPathURL's URLByAppendingPathComponent:("Contents/Info.plist") isDirectory:false
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistPathURL)
set strIconFileName to (ocidPlistDict's valueForKey:("CFBundleIconFile")) as text
###ICONのURLにして
set strPath to ("Contents/Resources/" & strIconFileName) as text
set ocidIconFilePathURL to ocidAppPathURL's URLByAppendingPathComponent:(strPath) isDirectory:false
###拡張子の有無チェック
set strExtensionName to (ocidIconFilePathURL's pathExtension()) as text
if strExtensionName is "" then
  set ocidIconFilePathURL to ocidIconFilePathURL's URLByAppendingPathExtension:"icns"
end if
##-->これがアイコンパス
log ocidIconFilePathURL's absoluteString() as text
###ICONファイルが実際にあるか?チェック
set boolExists to appFileManager's fileExistsAtPath:(ocidIconFilePathURL's |path|)
###ICONがみつかない時用にデフォルトを用意する
if boolExists is false then
  set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns"
else
  set aliasIconPath to ocidIconFilePathURL's absoluteURL() as alias
  set strIconPath to ocidIconFilePathURL's |path|() as text
end if
if strIconPath is (missing value) then
  set strIconPath to ""
end if

##########デフォルトアンサー
if strIdentityName is "" then
  ####OSのログイン名
  tell application "Finder"
    set strLongUserName to long user name of (system info) as text
  end tell
  set strDefaultAnswer to strLongUserName as text
log "環境設定>>ユーザー情報が登録されていません"
else
  ###Acrobatのユーザー情報設定
  set strDefaultAnswer to strIdentityName as text
end if
##############################
#####ダイアログを前面に出す
##############################
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder"
activate
  end tell
else
  tell current application
activate
  end tell
end if
try
  set recordResponse to (display dialog "ここに入力した名称に書き換えます" with title "注釈の名称変更します" default answer strDefaultAnswer buttons {"OK", "キャンセル"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 30 without hidden answer)
on error
log "エラーしました"
return "エラーしました"
  error number -128
end try
if true is equal to (gave up of recordResponse) then
return "時間切れですやりなおしてください"
  error number -128
end if
if "OK" is equal to (button returned of recordResponse) then
  ####戻りの値を設定します
  set strResponse to (text returned of recordResponse) as text
else
log "エラーしました"
return "エラーしました"
  error number -128
end if


################################
### ページ数
################################

tell application "Adobe Acrobat Reader"
activate
  tell active doc
    ####全面のドキュメントの
    ### ページ数
    set numAllPage to do script ("this.numPages;")
    ### 今のページ番号
    set numNowPage to do script ("this.pageNum;")
  end tell
end tell

################################
### ロック解除
################################
set numAnnoCnt to 0
repeat numLenge times
  tell application id "com.adobe.Reader"
    ########まずはロックを解除する
    try
do script ("this.selectedAnnots[" & numAnnoCnt & "].setProps({lock:'false'});")
do script ("this.selectedAnnots[" & numAnnoCnt & "].setProps({readOnly:'false'});")
    on error
do script ("this.selectedAnnots[" & numAnnoCnt & "].lock = false;")
do script ("this.selectedAnnots[" & numAnnoCnt & "].readOnly = false;")
    end try
    set numAnnoCnt to numAnnoCnt + 1
  end tell
end repeat
################################
### 注釈数のカウント
################################
set listAnnoID to {} as list
tell application id "com.adobe.Reader"
  tell page numNowPage
    try
      #####注釈カウント
      set theSelectedAnnots to do script ("this.selectedAnnots;")
      set numLenge to do script ("this.selectedAnnots.length;")
      
do script ("var objAllAnnots = this.selectedAnnots;")
do script ("var objAllAnnotsLength = this.selectedAnnots.length;")
      
    on error
display alert "エラー:注釈が選択されていません" buttons {"OK", "キャンセル"} default button "OK" as informational giving up after 10
return
    end try
  end tell
end tell
################################
### 注釈の内容をセット
################################
set numAnnoCnt to 0
tell application id "com.adobe.Reader"
  repeat numLenge times
    ####注釈の数だけ繰り返し
do script ("objAllAnnots[" & numAnnoCnt & "].setProps({ author:\"" & strResponse & "\"});")
    ## do script ("objAllAnnots[" & numAnnoCnt & "].setProps({ contents:\"" & strResponse & "\"});")
    set numAnnoCnt to numAnnoCnt + 1
  end repeat
end tell


#display notification "処理終了" with title "処理が終了" subtitle "処理が終了しました" sound name "Sonumi"
#log ">>>>>>>>>>>>処理終了<<<<<<<<<<<<<<<"
return ">>>>>>>>>>>>処理終了<<<<<<<<<<<<<<<"



###################################
### バンドルIDからアプリケーションURL
###################################
to doGetBundleID2AppURL(argBundleID)
  set strBundleID to argBundleID as text
  set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
  ##バンドルIDからアプリケーションのURLを取得
  set ocidAppBundle to (refMe's NSBundle's bundleWithIdentifier:(argBundleID))
  if ocidAppBundle ≠ (missing value) then
    set ocidAppPathURL to ocidAppBundle's bundleURL()
  else if ocidAppBundle = (missing value) then
    set ocidAppPathURL to (appSharedWorkspace's URLForApplicationWithBundleIdentifier:(argBundleID))
  end if
  ##予備(アプリケーションのURL)
  if ocidAppPathURL = (missing value) then
    tell application "Finder"
      try
        set aliasAppApth to (application file id strBundleID) as alias
        set strAppPath to (POSIX path of aliasAppApth) as text
        set strAppPathStr to refMe's NSString's stringWithString:(strAppPath)
        set strAppPath to strAppPathStr's stringByStandardizingPath()
        set ocidAppPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(strAppPath) isDirectory:true
      on error
return "アプリケーションが見つかりませんでした"
      end try
    end tell
  end if
return ocidAppPathURL
end doGetBundleID2AppURL


|

[Reader]選択した注釈の作成者名変更 (少し変更)


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

#!/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 framework "AppKit"
use framework "Quartz"
use framework "PDFKit"
use framework "QuartzCore"
use framework "CoreGraphics"
use scripting additions
property refMe : a reference to current application
set appFileManager to refMe's NSFileManager's defaultManager()

set strBundleID to ("com.adobe.Reader") as text

##################################
#### 文書を開いているか?
##################################
tell application id "com.adobe.Reader"
activate
  tell active doc
    set numAllPage to do script ("this.numPages;")
    set numNowPage to do script ("this.pageNum;")
    try
      if numAllPage is "undefined" then
        error number -1708
      end if
    on error
display alert "エラー:文書が選択されていません" buttons {"OK", "キャンセル"} default button "OK" as informational giving up after 10
return "エラー:文書が選択されていません"
    end try
  end tell
end tell
##################################
#### 注釈を選択しているか?
##################################
tell application id "com.adobe.Reader"
  ####ページ今のページ番号
  set numNowPage to do script ("this.pageNum;")
  tell page numNowPage
    try
      #### selectedAnnotsがエラーしたら選択していない
      set theSelectedAnnots to do script ("this.selectedAnnots;")
      if theSelectedAnnots is "undefined" then
        error number -1708
      end if
      set numLenge to do script ("this.selectedAnnots.length;")
    on error
display alert "エラー:注釈が選択されていません" buttons {"OK", "キャンセル"} default button "OK" as informational giving up after 30
return "エラー:注釈が選択されていません"
    end try
  end tell
end tell
##########################################
#### ユーザー情報取得
##########################################
tell application id "com.adobe.Reader"
launch
activate
  set objActivDoc to active doc
  try
    #### アクロバットの設定から氏名を取得する場合
    set strUserLastNamet to do script ("identity.lastName;") as text
    set strUserFirstNamet to do script ("identity.firstName;") as text
    #### 姓名を繋げて
    set strIdentityName to (strUserLastNamet & strUserFirstNamet) as text
    if strIdentityName is "" then
      set strIdentityName to "" as text
log "環境設定>>ユーザー情報が登録されていません"
    end if
  on error
    set strIdentityName to "" as text
log "環境設定>>ユーザー情報が登録されていません"
  end try
end tell
##########################################
####ダイアログ
##########################################
set ocidAppPathURL to doGetBundleID2AppURL(strBundleID)
####ダイアログに指定アプリのアイコンを表示する
set strIconPath to ""
###アイコン名をPLISTから取得
set ocidPlistPathURL to ocidAppPathURL's URLByAppendingPathComponent:("Contents/Info.plist") isDirectory:false
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistPathURL)
set strIconFileName to (ocidPlistDict's valueForKey:("CFBundleIconFile")) as text
###ICONのURLにして
set strPath to ("Contents/Resources/" & strIconFileName) as text
set ocidIconFilePathURL to ocidAppPathURL's URLByAppendingPathComponent:(strPath) isDirectory:false
###拡張子の有無チェック
set strExtensionName to (ocidIconFilePathURL's pathExtension()) as text
if strExtensionName is "" then
  set ocidIconFilePathURL to ocidIconFilePathURL's URLByAppendingPathExtension:"icns"
end if
##-->これがアイコンパス
log ocidIconFilePathURL's absoluteString() as text
###ICONファイルが実際にあるか?チェック
set boolExists to appFileManager's fileExistsAtPath:(ocidIconFilePathURL's |path|)
###ICONがみつかない時用にデフォルトを用意する
if boolExists is false then
  set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns"
else
  set aliasIconPath to ocidIconFilePathURL's absoluteURL() as alias
  set strIconPath to ocidIconFilePathURL's |path|() as text
end if
if strIconPath is (missing value) then
  set strIconPath to ""
end if



##########デフォルトアンサー
if strIdentityName is "" then
  ####OSのログイン名
  tell application "Finder"
    set strLongUserName to long user name of (system info) as text
  end tell
  set strDefaultAnswer to strLongUserName as text
log "環境設定>>ユーザー情報が登録されていません"
else
  ###Acrobatのユーザー情報設定
  set strDefaultAnswer to strIdentityName as text
end if
##############################
#####ダイアログを前面に出す
##############################
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder"
activate
  end tell
else
  tell current application
activate
  end tell
end if
try
  set recordResponse to (display dialog "ここに入力した名称に書き換えます" with title "注釈の名称変更します" default answer strDefaultAnswer buttons {"OK", "キャンセル"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 30 without hidden answer)
on error
log "エラーしました"
return "エラーしました"
  error number -128
end try
if true is equal to (gave up of recordResponse) then
return "時間切れですやりなおしてください"
  error number -128
end if
if "OK" is equal to (button returned of recordResponse) then
  ####戻りの値を設定します
  set strResponse to (text returned of recordResponse) as text
else
log "エラーしました"
return "エラーしました"
  error number -128
end if


################################
### ページ数
################################

tell application "Adobe Acrobat Reader"
activate
  tell active doc
    ####全面のドキュメントの
    ### ページ数
    set numAllPage to do script ("this.numPages;")
    ### 今のページ番号
    set numNowPage to do script ("this.pageNum;")
  end tell
end tell

################################
### ロック解除
################################
set numAnnoCnt to 0
repeat numLenge times
  tell application id "com.adobe.Reader"
    ########まずはロックを解除する
    try
do script ("this.selectedAnnots[" & numAnnoCnt & "].setProps({lock:'false'});")
do script ("this.selectedAnnots[" & numAnnoCnt & "].setProps({readOnly:'false'});")
    on error
do script ("this.selectedAnnots[" & numAnnoCnt & "].lock = false;")
do script ("this.selectedAnnots[" & numAnnoCnt & "].readOnly = false;")
    end try
    set numAnnoCnt to numAnnoCnt + 1
  end tell
end repeat
################################
### 注釈数のカウント
################################
set listAnnoID to {} as list
tell application id "com.adobe.Reader"
  tell page numNowPage
    try
      #####注釈カウント
      set theSelectedAnnots to do script ("this.selectedAnnots;")
      set numLenge to do script ("this.selectedAnnots.length;")
      
do script ("var objAllAnnots = this.selectedAnnots;")
do script ("var objAllAnnotsLength = this.selectedAnnots.length;")
      
    on error
display alert "エラー:注釈が選択されていません" buttons {"OK", "キャンセル"} default button "OK" as informational giving up after 10
return
    end try
  end tell
end tell
################################
### 注釈の内容をセット
################################
set numAnnoCnt to 0
tell application id "com.adobe.Reader"
  repeat numLenge times
    ####注釈の数だけ繰り返し
do script ("objAllAnnots[" & numAnnoCnt & "].setProps({ author:\"" & strResponse & "\"});")
    set numAnnoCnt to numAnnoCnt + 1
  end repeat
end tell


display notification "処理終了" with title "処理が終了" subtitle "処理が終了しました" sound name "Sonumi"
log ">>>>>>>>>>>>処理終了<<<<<<<<<<<<<<<"
return ">>>>>>>>>>>>処理終了<<<<<<<<<<<<<<<"



###################################
### バンドルIDからアプリケーションURL
###################################
to doGetBundleID2AppURL(argBundleID)
  set strBundleID to argBundleID as text
  set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
  ##バンドルIDからアプリケーションのURLを取得
  set ocidAppBundle to (refMe's NSBundle's bundleWithIdentifier:(argBundleID))
  if ocidAppBundle ≠ (missing value) then
    set ocidAppPathURL to ocidAppBundle's bundleURL()
  else if ocidAppBundle = (missing value) then
    set ocidAppPathURL to (appSharedWorkspace's URLForApplicationWithBundleIdentifier:(argBundleID))
  end if
  ##予備(アプリケーションのURL)
  if ocidAppPathURL = (missing value) then
    tell application "Finder"
      try
        set aliasAppApth to (application file id strBundleID) as alias
        set strAppPath to (POSIX path of aliasAppApth) as text
        set strAppPathStr to refMe's NSString's stringWithString:(strAppPath)
        set strAppPath to strAppPathStr's stringByStandardizingPath()
        set ocidAppPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(strAppPath) isDirectory:true
      on error
return "アプリケーションが見つかりませんでした"
      end try
    end tell
  end if
return ocidAppPathURL
end doGetBundleID2AppURL


|

[Acrobat]クラウドストレージから開いているPDFをブラウザで開く


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

#!/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 framework "AppKit"
use scripting additions
property refMe : a reference to current application


set strBundleID to ("com.adobe.Reader") as text
###########################
###アプリケーションが起動しているか
set ocidRunningApplication to refMe's NSRunningApplication
set ocidAppArray to (ocidRunningApplication's runningApplicationsWithBundleIdentifier:(strBundleID))
set itemAppArray to ocidAppArray's firstObject()
if itemAppArray is (missing value) then
  display alert "エラー:アプリケーションが起動していません" buttons {"OK", "キャンセル"} default button "OK" as informational giving up after 2
return "エラー:アプリケーションが起動していません"
end if

###アプリケーションのWINDOWがあるか?
tell application id strBundleID
  set numCntWindow to (count of every window) as integer
end tell
if numCntWindow = 0 then
  display alert "エラー:pdfを開いていません" buttons {"OK", "キャンセル"} default button "OK" as informational giving up after 2
return "エラー:pdfを開いていません"
end if
####必要な情報の取得(As版)
tell application "Adobe Acrobat Reader"
  tell active doc
    ##総ページ数
    set numAllPage to (count of every page) as integer
  end tell
  tell front PDF Window
    ##表示中のページ番号
    set numNowPage to (page number) as integer
  end tell
  tell active doc
    ##ファイル名
    set strFileName to name as text
    ##パス取得
    try
      set aliasFilePath to file alias as alias
return "ローカルディスクから開いています"
    on error
      ###ファイルパス
do script "var strFileFullPath = this.path;"
      set strFileFullPath to (do script "this.path;") as text
      if strFileFullPath starts with "/Acrobat.com" then
        log "クラウドドキュメントです"
        ###アセットIDを取得
do script "var match = strFileFullPath.match(/urn:aaid:sc:us:[\\w-]+/);"
        set strAssetID to (do script "strFileFullPath.match(/urn:aaid:sc:us:[\\w-]+/);")
      end if
    end try
  end tell
end tell
###########################
###URL整形
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
###スキーム を追加
ocidURLComponents's setScheme:("https")
###ホスト追加
ocidURLComponents's setHost:("acrobat.adobe.com")
###パスを追加(setHostじゃないよ)
ocidURLComponents's setPath:("/link/file")
##クエリー部
set ocidQueryItems to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
##ファイルタイプ クエリー1
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("filetype") value:("application/pdf")
ocidQueryItems's addObject:(ocidQueryItem)
##アセットID クエリー2
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("uri") value:(strAssetID)
ocidQueryItems's addObject:(ocidQueryItem)
##クエリーをセットする
ocidURLComponents's setQueryItems:(ocidQueryItems)
##URLに戻して テキストにしておく
set ocidOpenURL to ocidURLComponents's |URL|()
set strOpenURL to ocidOpenURL's absoluteString() as text
###########################
###デフォルトのブラウザで開く
tell application "Finder"
  open location strOpenURL
end tell


|

[bash]旧バージョンのAdobeReaderに戻す

ダウンロード - extractadobereader.zip


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

#!/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 "AppKit"
use framework "UniformTypeIdentifiers"
use scripting additions
property refMe : a reference to current application

set strUTL to ("https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300320284/AcroRdrDCUpd2300320284_MUI.dmg") as text
set strDMGFileName to "AcroRdrDCUpd2300320284_MUI.dmg" as text


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

########################################
###ダウンロードファイルを保存する起動時に削除される項目
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidTempDirURL to appFileManager's temporaryDirectory()
set ocidUUID to refMe's NSUUID's alloc()'s init()
set ocidUUIDString to ocidUUID's UUIDString
set ocidSaveDirPathURL to ocidTempDirURL's URLByAppendingPathComponent:(ocidUUIDString) isDirectory:true
##
set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
# 777-->511 755-->493 700-->448 766-->502
ocidAttrDict's setValue:(511) forKey:(refMe's NSFilePosixPermissions)
set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)

########################################
###ダウンロード
##保存パス
set ocidSaveDMGPathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:(strDMGFileName) isDirectory:false
set strSaveDMGPathURL to (ocidSaveDMGPathURL's |path|()) as text
###ダウンロードURL
###コマンド実行
set strCommandText to ("/usr/bin/curl -L -o \"" & strSaveDMGPathURL & "\" \"" & strUTL & "\" --connect-timeout 20") as text
do shell script strCommandText

########################################
###DMGマウント
###マウントポイント
set ocidMountPointPathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("MountPoint/DC/") isDirectory:true
set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidMountPointPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)
set strMountPointPathURL to (ocidMountPointPathURL's |path|()) as text
###コマンド実行
set strCommandText to ("/usr/bin/hdiutil attach \"" & strSaveDMGPathURL & "\" -noverify -nobrowse -noautoopen -mountpoint \"" & strMountPointPathURL & "\"") as text
do shell script strCommandText

########################################
###マウントされたボリュームからPKGを解凍
###PKGURL
set ocidPkgPathURL to ocidMountPointPathURL's URLByAppendingPathComponent:("AcroRdrDCUpd2300320284_MUI.pkg") isDirectory:false
set strPkgPath to (ocidPkgPathURL's |path|()) as text
###pkgの展開先
set ocidExpandDirPathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("Expand") isDirectory:true
set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidExpandDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)
set ocidExpandPKGPathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("Expand/Expand.pkg") isDirectory:true
set strExpandPKGPath to (ocidExpandPKGPathURL's |path|()) as text
####コマンド実行
set strComandText to "/usr/sbin/pkgutil --expand \"" & strPkgPath & "\" \"" & strExpandPKGPath & "\"" as text
do shell script strComandText

####解凍が終わったらDMGのマウント解除
set strComandText to "/usr/bin/hdiutil detach \"" & strMountPointPathURL & "\" -force" as text
do shell script strComandText


########################################
###Payloadを解凍しながら複製
###Payloadのパス
set ocidPayloadPathURL to ocidExpandPKGPathURL's URLByAppendingPathComponent:("payload.pkg/Payload") isDirectory:true
set strPayloadPath to (ocidPayloadPathURL's |path|()) as text
###解凍先
set ocidExtractDirPathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("Extract") isDirectory:true
set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidExtractDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)
set strExtractDirPath to (ocidExtractDirPathURL's |path|()) as text

set strComandText to ("/usr/bin/ditto -xz \"" & strPayloadPath & "\"   \"" & strExtractDirPath & "\"") as text
do shell script strComandText

########################################
###7zファイルを解凍
###コマンドへのパス
set ocid7zzPathURL to ocidExpandPKGPathURL's URLByAppendingPathComponent:("acropython3.pkg/Scripts/Tools/7zz") isDirectory:true
set str7zzPath to (ocid7zzPathURL's |path|()) as text
###解凍するファイル
set ocid7zArcPathURL to ocidExtractDirPathURL's URLByAppendingPathComponent:("MUI.7z") isDirectory:true
set str7zArcPat to (ocid7zArcPathURL's |path|()) as text
set strComandText to (" \"" & str7zzPath & "\" x \"" & str7zArcPat & "\" -o\"" & strExtractDirPath & "\" -y -snld") as text
do shell script strComandText

########################################
###解凍されたアプリケーションの移動
set ocidAppPathURL to ocidExtractDirPathURL's URLByAppendingPathComponent:("MUI/Application/Adobe Acrobat Reader DC.app") isDirectory:true
###ダウンロードディレクトリに移動
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDownloadsDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDownloadsDirPathURL to ocidURLsArray's firstObject()
set ocidMoveAppPathURL to ocidDownloadsDirPathURL's URLByAppendingPathComponent:("Adobe Acrobat Reader DC.app") isDirectory:true
####
set lisrDone to appFileManager's moveItemAtURL:(ocidAppPathURL) toURL:(ocidMoveAppPathURL) |error|:(reference)

##表示
set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
set boolDone to appSharedWorkspace's selectFile:(ocidMoveAppPathURL's |path|()) inFileViewerRootedAtPath:(ocidDownloadsDirPathURL's |path|())
###結果
if boolDone is false then
return "エラーしました"
end if



|

[bash]旧バージョンのAdobeReaderに戻す

ダウンロード - extractadobereader.zip


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

#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
#
#################################################
###管理者インストールしているか?チェック
USER_WHOAMI=$(/usr/bin/whoami)
/bin/echo "実行ユーザー(whoami): $USER_WHOAMI"
SCRIPT_PATH="${BASH_SOURCE[0]}"
/bin/echo "/usr/bin/sudo \"$SCRIPT_PATH\""
###実行しているユーザー名
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"

########################################
###ダウンロード
###ダウンロード起動時に削除する項目
USER_TEMP_DIR=$(/usr/bin/mktemp -d)
/bin/echo "起動時に削除されるディレクトリ:" "$USER_TEMP_DIR"

/bin/echo "ダウンロード開始"
###ダウンロードURL
STR_URL="https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/2300320284/AcroRdrDCUpd2300320284_MUI.dmg"
/usr/bin/curl -Lv "$STR_URL" -o "$USER_TEMP_DIR/AcroRdrDCUpd.dmg"
/bin/echo "ダウンロード終了"
########################################
###DMGからPKGを取り出す
/bin/echo "DMGマウント :開始"
###マウントする場所を作成
/bin/mkdir -p "$USER_TEMP_DIR/MountPoint/DC"
/bin/chmod 777 "$USER_TEMP_DIR/MountPoint/DC"
###マウント
/usr/bin/hdiutil attach "$USER_TEMP_DIR/AcroRdrDCUpd.dmg" -noverify -nobrowse -noautoopen -mountpoint "$USER_TEMP_DIR/MountPoint/DC"
/bin/echo "PKG解凍 :開始"
###解凍先を作成
/bin/mkdir -p "$USER_TEMP_DIR/Expand"
/bin/chmod 777 "$USER_TEMP_DIR/Expand"
###PKG解凍
/usr/sbin/pkgutil --expand "$USER_TEMP_DIR/MountPoint/DC/AcroRdrDCUpd2300320284_MUI.pkg" "$USER_TEMP_DIR/Expand/Expand.pkg"
###DMGをアンマウント
/usr/bin/hdiutil detach "$USER_TEMP_DIR/MountPoint/DC" -force
/bin/echo "PKG解凍 :完了"
########################################
###Payload解凍
/bin/echo "Payload解凍 :開始"
/bin/mkdir -p "$USER_TEMP_DIR/7z"
/bin/chmod 777 "$USER_TEMP_DIR/7z"
/usr/bin/ditto -xzv "$USER_TEMP_DIR/Expand/Expand.pkg/payload.pkg/Payload" "$USER_TEMP_DIR/7z"
/bin/echo "Payload解凍 :完了"
########################################
###7z解凍
/bin/echo "7zz解凍 :開始"
/bin/mkdir -p "$USER_TEMP_DIR/Extract"
/bin/chmod 777 "$USER_TEMP_DIR/Extract"
"$USER_TEMP_DIR/Expand/Expand.pkg/acropython3.pkg/Scripts/Tools/7zz" x "$USER_TEMP_DIR/7z/MUI.7z"   -o"$USER_TEMP_DIR/Extract" -y -snld

/bin/echo "7zz解凍 :完了"
########################################
###ダウンロードフォルダへ移動
/bin/echo "終了処理 :開始"
/bin/mkdir -p "/Users/$CONSOLE_USER/Downloads/Adobe Acrobat Reader DC"
/bin/chmod 777 "/Users/$CONSOLE_USER/Downloads/Adobe Acrobat Reader DC"

/bin/mv -f "$USER_TEMP_DIR/Extract/MUI/Application/Adobe Acrobat Reader DC.app" "/Users/$CONSOLE_USER/Downloads/Adobe Acrobat Reader DC"
/usr/bin/open "/Users/$CONSOLE_USER/Downloads/Adobe Acrobat Reader DC"

###ダウンロードに使ったフォルダをゴミ箱に入れる
/bin/mv -f "$USER_TEMP_DIR" "/Users/$CONSOLE_USER/.Trash"


/bin/echo "ダウンロードフォルダに解凍しました"

exit 0


|

より以前の記事一覧

その他のカテゴリー

Acrobat Acrobat Annotation Acrobat Dialog Acrobat Form Acrobat JS Acrobat Open Acrobat Plugin Acrobat python Acrobat Reader Acrobat Sequ Acrobat Stamps Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin System Information Admin Tools Admin Users Admin Volumes Adobe Apple AppleScript AppleScript Guide AppleScript Accessibility AppleScript AppKit AppleScript Applications AppleScript AppStore AppleScript Archive AppleScript Attributes AppleScript Automator AppleScript AVAsset AppleScript AVconvert AppleScript AVFoundation AppleScript AVURLAsset AppleScript BackUp AppleScript Barcode AppleScript Bash AppleScript Basic AppleScript Basic Path AppleScript Bluetooth AppleScript BOX AppleScript Browser AppleScript Calendar AppleScript CD/DVD AppleScript Choose AppleScript Chrome AppleScript CIImage AppleScript CloudStorage AppleScript Color AppleScript com.apple.LaunchServices.OpenWith AppleScript Console AppleScript Contacts AppleScript CotEditor AppleScript CURL AppleScript current application AppleScript Date&Time AppleScript delimiters AppleScript Desktop AppleScript Device AppleScript Disk AppleScript do shell script AppleScript Dock AppleScript DropBox AppleScript eMail AppleScript Encode Decode AppleScript Error AppleScript EXIFData AppleScript ffmpeg AppleScript File AppleScript Finder AppleScript Firefox AppleScript Folder AppleScript Fonts AppleScript GIF AppleScript HTML AppleScript Icon AppleScript Illustrator AppleScript Image Events AppleScript Image2PDF AppleScript ImageOptim Applescript iWork AppleScript Javascript AppleScript Jedit AppleScript Json AppleScript Label AppleScript List AppleScript locationd AppleScript LRC AppleScript LSSharedFileList AppleScript m3u8 AppleScript MakePDF AppleScript Map AppleScript Math AppleScript Microsoft AppleScript Microsoft Edge AppleScript Microsoft Excel AppleScript Mobileconfig AppleScript Mouse AppleScript Movie AppleScript Music AppleScript NetWork AppleScript Notes AppleScript NSArray AppleScript NSBitmapImageRep AppleScript NSBundle AppleScript NSCFBoolean AppleScript NSCharacterSet AppleScript NSColor AppleScript NSColorList AppleScript NSData AppleScript NSDictionary AppleScript NSError AppleScript NSEvent AppleScript NSFileAttributes AppleScript NSFileManager AppleScript NSFont AppleScript NSFontManager AppleScript NSImage AppleScript NSIndex AppleScript NSKeyedArchiver AppleScript NSKeyedUnarchiver AppleScript NSLocale AppleScript NSMutableArray AppleScript NSMutableDictionary AppleScript NSMutableString AppleScript NSNotFound AppleScript NSNumber AppleScript NSOpenPanel AppleScript NSPasteboard AppleScript NSPDFImageRep AppleScript NSpoint AppleScript NSPredicate AppleScript NSRange AppleScript NSRegularExpression AppleScript NSRunningApplication AppleScript NSScreen AppleScript NSSize AppleScript NSString AppleScript NSStringCompareOptions AppleScript NSTask AppleScript NSTimeZone AppleScript NSURL AppleScript NSURL File AppleScript NSURLBookmark AppleScript NSURLComponents AppleScript NSURLResourceKey AppleScript NSUserDefaults AppleScript NSUUID AppleScript NSView AppleScript NSWorkspace AppleScript Numbers AppleScript OAuth AppleScript ObjC AppleScript OneDrive AppleScript Osax AppleScript PDF AppleScript PDFAnnotationWidget AppleScript PDFContext AppleScript PDFDisplayBox AppleScript PDFDocumentPermissions AppleScript PDFKit AppleScript PDFnUP AppleScript PDFOutline AppleScript Photos AppleScript Photoshop AppleScript Plist System Events AppleScript PostScript AppleScript prefPane AppleScript Preview AppleScript Python AppleScript QR AppleScript QR Decode AppleScript QuickLook AppleScript QuickTime AppleScript record AppleScript Regular Expression AppleScript Reminders AppleScript ReName AppleScript Repeat AppleScript RTF AppleScript Safari AppleScript SaveFile AppleScript ScreenCapture AppleScript ScreenSaver AppleScript Script Editor AppleScript Script Menu AppleScript Shortcuts AppleScript Shortcuts Events AppleScript Sort AppleScript Sound AppleScript Spotlight AppleScript SRT AppleScript StandardAdditions AppleScript stringByApplyingTransform AppleScript System Events AppleScript System Settings AppleScript TemporaryItems AppleScript Terminal AppleScript Text AppleScript Text CSV AppleScript Text TSV AppleScript TextEdit AppleScript Translate AppleScript Trash AppleScript Twitter AppleScript UI AppleScript Unit Conversion AppleScript UTType AppleScript valueForKeyPath AppleScript Video AppleScript VisionKit AppleScript Visual Studio Code AppleScript webarchive AppleScript webp AppleScript Wifi AppleScript XML AppleScript XML EPUB AppleScript XML OPML AppleScript XML Plist AppleScript XML RSS AppleScript XML SVG AppleScript XML TTML AppleScript XML webloc AppleScript YouTube AppleScript Zero Suppress Applications Barcode OnLine Tools CityCode Design iPhone List Logs lsappinfo Memo Music perl PlistBuddy pluginkit postalcode ReadMe SF Symbols character id SF Symbols Entity sips Skype Slack sqlite TCC Tools Typography Video Wacom zoom