Acrobat AppleScripts

【Acrobat】Acrobatフォームでデータ印字(はがき宛名)

【Acrobat】Acrobatフォームでデータ印字(その1)の続編
https://force4u.cocolog-nifty.com/skywalker/cat75986021/index.html

ハガキPDFフォームのデータPDF作成

こんな感じのハガキのフォームを
Screencapture-20210821-172947

データ読み込みで個別のPDFにします
Screencapture-20210821-173029

出来上がりPDFは氏名データでファイル名定義して保存します
Screencapture-20210821-173125


ダウンロード - makehagakidataprintpdfform.zip

|

【Acrobat AppleScripts】フルスクリーン開始

Acrobatfullsc
スクリプトメニュー用です

ダウンロード



(*

Acrobatのフルスクリーン開始用
20210805 思い出して再作成





*)
set theList to {"UncoverLeft", "UncoverRight", "UncoverDown", "UncoverUp", "UncoverLeftDown", "UncoverLeftUp", "UncoverRightDown", "UncoverRightUp", "CoverLeft", "CoverRight", "CoverDown", "CoverUp", "CoverLeftDown", "CoverLeftUp", "CoverRightDown", "CoverRightUp", "PushLeft", "PushRight", "PushDown", "PushUp", "PushLeftDown", "PushLeftUp", "PushRightDown", "PushRightUp", "FlyInRight", "FlyInLeft", "FlyInDown", "FlyInUp", "FlyOutRight", "FlyOutLeft", "FlyOutDown", "FlyOutUp", "FlyIn", "FlyOut", "Blend", "Fade", "Random", "Dissolve", "GlitterRight", "GlitterDown", "GlitterRightDown", "BoxIn", "BoxOut", "BlindsHorizontal", "BlindsVertical", "SplitHorizontalIn", "SplitHorizontalOut", "SplitVerticalIn", "SplitVerticalOut", "WipeLeft", "WipeRight", "WipeDown", "WipeUp", "WipeLeftDown", "WipeLeftUp", "WipeRightDown", "WipeRightUp", "Replace", "ZoomInDown", "ZoomInLeft", "ZoomInLeftDown", "ZoomInLeftUp", "ZoomInRight", "ZoomInRightDown", "ZoomInRightUp", "ZoomInUp", "ZoomOutDown", "ZoomOutLeft", "ZoomOutLeftDown", "ZoomOutLeftUp", "ZoomOutRight", "ZoomOutRightDown", "ZoomOutRightUp", "ZoomOutUp", "CombHorizontal", "CombVertical"} as list

tell application "Finder"
---主名称指定
activate
set theChoices to theList
set theTransition to choose from list theChoices with prompt "トランジッションを選んでください" default items {"Random"}
----戻り値をテキストに
set theTransition to theTransition as text
end tell
log theTransition

tell application "Finder"
---主名称指定
activate
set objDialog to (display dialog "ページ送り秒(半角数字で)" default answer "5" giving up after 20 with title "ページ送り秒")
set numSecPage to (text returned of objDialog) as text
----戻り値を数字にエラーしたら5秒
try
set numSecPage to (numSecPage + numSecPage) / 2 as integer
on error
set numSecPage to "5" as integer
end try
end tell
log numSecPage

tell application "Finder"
set listRGBcolor to (choose color default color {65535, 65535, 65535})
end tell

set theR to ((item 1 of listRGBcolor) / 65535) as number
set theG to ((item 2 of listRGBcolor) / 65535) as number
set theB to ((item 3 of listRGBcolor) / 65535) as number



tell application "Adobe Acrobat"
activate

tell window 1

---トランジッション
do script "app.fs.defaultTransition = \"" & theTransition & "\";"
---ツールバー有無
do script "app.toolbar = false;"
---カーソル有無
do script "app.fs.cursor = cursor.visible;"
---クリック有用(ホイール)
do script "app.fs.clickAdvances = true;"
do script "app.fs.useTimer = true;"
do script "app.fs.usePageTiming = true;"
---ループ
do script "app.fs.loop = true;"
---背景色
do script "app.fs.backgroundColor = [\"RGB\"," & theR & ", " & theG & "," & theB & "];"

---do script "app.fs.backgroundColor = [\"CMYK\", 1, 0, 0,0];"
---do script "app.fs.backgroundColor = [\"RGB\", 1, 0, 0];"
---do script "app.fs.backgroundColor = [\"RGB\",0.7, 0.1, 0.1, 0.5];"
---do script "app.fs.backgroundColor = color.white;"
---do script "app.fs.backgroundColor = [\"G\", 0.5,0.2];"
---ページ送り時間
do script "app.fs.timeDelay = \"" & numSecPage & "\";"

do script "app.execMenuItem(\"FullScreenMode\");"



end tell

end tell

|

[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



|

[Acrobat AppleScript]PDFを開いてTIFFで書き出す(バージョンによる差異)

上書きオプション等はAcrobat7からなので
バージョンを取得して分岐を作る

それぞれ記述を変える

対応できますね。

Website_image20110408_135815

続きを読む "[Acrobat AppleScript]PDFを開いてTIFFで書き出す(バージョンによる差異)"

| | トラックバック (0)

[Acrobat AppleScript]ファイルサイズの取得(this.filesize)

Website_image20110330_193140

続きを読む "[Acrobat AppleScript]ファイルサイズの取得(this.filesize)"

| | トラックバック (0)

[Acrobat AppleScript]ファイル名の取得(this.documentFileName)

Website_image20110330_184845

続きを読む "[Acrobat AppleScript]ファイル名の取得(this.documentFileName)"

| | トラックバック (0)

[Acrobat AppleScript]PDFを開いてTIFFで書き出す(Export to TIFF Image : Adobe Acrobat)

do script を使ってこのようにする事で
ロングファイルネームの不具合に対応出来ます。

Website_image20110320_155351


「acro_Long_filename.rtf」をダウンロード

Acrotext


set FileResult to choose file "変更するファイルを選択"
set savefolder to choose folder with prompt ("TIFファイルの保存先を選択してください。" as Unicode text)
set destinationFolder to savefolder as Unicode text

tell application "Finder"
set theName to name of FileResult
set newfile to destinationFolder & text 1 thru -4 of theName & "tif" as Unicode text
set newfilepass to POSIX path of newfile as Unicode text

end tell


tell application "Adobe Acrobat Pro"
open FileResult as alias

set comandline to "" as Unicode text

do script "this.saveAs(\"" & newfilepass & "\", \"com.adobe.acrobat.tiff\");"

close active doc saving no
end tell

続きを読む "[Acrobat AppleScript]PDFを開いてTIFFで書き出す(Export to TIFF Image : Adobe Acrobat)"

| | コメント (0) | トラックバック (0)

その他のカテゴリー

Accessibility AccessibilityCheck AccessibilityForm AccessibilityInDesign AccessibilityPDF Acrobat Acrobat Action Acrobat Annotation Acrobat AppleScripts Acrobat Character Acrobat Layer Acrobat PDF Embed API Acrobat PDF Form Print Acrobat Plug-ins Acrobat Portfolios Acrobat Print AcrobatBarcode AcrobatDialog AcrobatForm AcrobatJS AcrobatMenu AcrobatPDF AcrobatStamp AcrobatYouTube AddressBook Adobe Adobe InDesign Adobe Photoshop AdobeAppleScript AdobeBridge AdobeIllustrator AdobeJSX aed Alfresco Android AnimationGif Apple Apple Support AppleScript AppleScriptBasics AppleScriptCharacter AppleScriptColor AppleScriptDroplet AppleScriptErrorNum AppleScriptFolder AppleScriptFontBook AppleScriptRename AppleScriptTools AppleSymbols Applications Barcode Barcode2D BarcodePostal BetterHTMLExport Book BOX Browser buzz Certificates CharacterEntity CharacterSets Colors Cool Site CSS Cutting DecoMail DecorationMail Design Desktop Diff DJ dmg DNS Documents Download DTP eBook Editer eMail Envelopes ExifTool Facebook FFmpeg File System Fonts FontsTool FontsWeb FOOD FormPrint ftp Gadget Gif Animation Google Google Chrome Enterprise 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 Setup Mac Spotlight Mac Video Map Memo Microsoft Teams Mobby mobileconfig Moto Movies Music Network Basic ntp OCR Office OfficePowerPoint OSX Paint Pantone Paper PDFlib Permission Photo Pictograms Print Public Python 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