Acrobat AppleScripts

[Acrobat AppleScripts]アプリケーションの画面サイズ

(*
theStatusMenuShowHideの22はFinderメニューバーのサイズ
Acrobatで開いた書類を画面最大サイズにリサイズする

*)
---画面サイズを求める
tell application "Finder"
set theWindowSize to (bounds of window of desktop) as list
set theDesktopWidth to (item 3 of theWindowSize) as number
set theDesktopHight to (item 4 of theWindowSize) as number
end tell
----ドックのサイズを求める
tell application "System Events"
tell application process "Dock"
set {dockWidth, dockHeight} to the size of list 1
end tell
tell dock preferences
set theScreenEdge to screen edge as text
set theAutohide to autohide as text
end tell
end tell

set theStatusMenuShowHide to (do shell script "/usr/bin/defaults read NSGlobalDomain _HIHideMenuBar") as number

if theStatusMenuShowHide is 0 then
set theMenuBarHight to 22 as number
else
set theMenuBarHight to 0 as number
end if
---アクロバットの処理
tell application "Adobe Acrobat"
---ファイルを開いて
open (choose file of type {"com.adobe.pdf"})
activate
tell active doc
---アプリケーションウィンドウのサイズを取得
set theDocBounds to bounds as list
end tell
--左から
set theDocBounds01 to (item 1 of theDocBounds) as number
--上から(メニュー部分を加味)
set theDocBounds02 to (item 2 of theDocBounds) as number
--
set theDocBounds03 to (item 3 of theDocBounds) as number
--
set theDocBounds04 to (item 4 of theDocBounds) as number
---DOCKが隠れない場合
if theAutohide is "false" then
--DOCKの位置が下の場合
if theScreenEdge is "bottom" then
set theDockSize to dockHeight as number
set theAcroWindowBounds to {0, theMenuBarHight, theDesktopWidth, (theDesktopHight - theMenuBarHight - theDockSize)}
--DOCKの位置が左か右の場合
else
set theDockSize to dockWidth as number
set theAcroWindowBounds to {0, theMenuBarHight, (theDesktopWidth - theDockSize), (theDesktopHight - theMenuBarHight)}
end if
---DOCKが隠れる場合
else
--DOCKの位置が下の場合
if theScreenEdge is "bottom" then
set theDockSize to dockHeight as number
set theAcroWindowBounds to {0, theMenuBarHight, theDesktopWidth, (theDesktopHight - theMenuBarHight)}
--DOCKの位置が左か右の場合
else
set theDockSize to dockWidth as number
set theAcroWindowBounds to {0, theMenuBarHight, (theDesktopWidth), (theDesktopHight - theMenuBarHight)}
end if
end if
--アプリケーションウィンドウをリサイズする
tell active doc
set bounds to theAcroWindowBounds
end tell
activate
end tell



ダウンロード - acrobatbounds.zip



|

その他のカテゴリー

Accessibility AccessibilityCheck AccessibilityForm AccessibilityInDesign AccessibilityPDF Acrobat Acrobat Action Acrobat Annotation Acrobat AppleScript Acrobat AppleScripts Acrobat Layer Acrobat Plug-ins Acrobat Portfolios Acrobat Print AcrobatBarcode AcrobatDialog AcrobatForm AcrobatJS AcrobatMenu AcrobatPDF AcrobatStamp AcrobatYouTube AddressBook Adobe Adobe InDesign AdobeAppleScript AdobeBridge AdobeIllustrator AdobeJSX aed Alfresco Android AnimationGif Apple AppleScript AppleScriptBasics AppleScriptCharacter AppleScriptColor AppleScriptDroplet AppleScriptErrorNum AppleScriptFolder AppleScriptFontBook AppleScriptRename AppleScriptTools AppleSymbols Applications Barcode Barcode2D BarcodePostal BetterHTMLExport Book Browser buzz Certificates CharacterEntity CharacterSets Colors Cool Site CSS Cutting DecoMail DecorationMail Design Desktop Diff DJ dmg DNS Document Cloud PDF Embed API Documents Download DTP eBook Editer eMail Envelopes ExifTool Facebook FFmpeg File System Fonts FontsTool FontsWeb FOOD FormPrint ftp Gadget Gif Animation Google HexEditor HTML info iPhoto ISBN ISO iTunes iWork iWorkNumbers iWorkNumbersCalendar iWorkNumbersTimecard iWorkPages JavaScript JeditX JeditX Regexp JeditXAppleScript JIS jquery Letterpress Library logo Mac Admin Mac Archiver Mac Browser Mac Browser Plugin Mac QuickLook Mac Spotlight Mac Video Map Microsoft Teams Mobby Moto Movies Music Network Basic ntp OCR Office OfficePowerPoint OSX Paint Pantone Paper PDFlib Permission Photo Pictograms Print Public QuickLook QuickTime QuickTimeSetting QuickTimeSound Real Media ReName ResourceFork ruby Sample Screen ScreenCast Search Security SEO Sharing SLAResource Sound Spotlight Stamp SWF TCC.db Tutorial PSD TV Twitter Typography Unicode Utilities Video WEB APP WebFont Wedding Windows WindowsMedia XML XMP XPS YouTube YouTube Rss