[Link Annotation]特定の条件の場合のみ値を変更する
サンプルはリンク注釈のリンク先ページでの分岐
#!/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.6"
use framework "Foundation"
use scripting additions
##############################################
tell application "Adobe Acrobat"
activate
tell active doc
set numAllPage to do script ("this.numPages;")
set numNowPage to do script ("this.pageNum;")
try
set numJsNowPage to (numNowPage - 1)
on error
display alert "エラー:文書を開いていません" buttons {"OK", "キャンセル"} default button "OK" as informational giving up after 10
return
end try
end tell
end tell
##############################################
tell application "Adobe Acrobat"
tell front document
tell front PDF Window
set numNowPage to (page number) as number
log "表示中のページは:" & numNowPage & "ページ"
set numAllPage to (count every page) as number
log "全:" & numNowPage & "ページのPDF書類です"
end tell
end tell
end tell
##############################################
set numJsNowPage to 0
set numChkPage to 1
repeat numAllPage times
tell application "Adobe Acrobat"
tell front document
tell front PDF Window
tell page numChkPage
set objPageAnnot to every annotation
set numPageAnnotCnt to count objPageAnnot
log "ページNO:" & numChkPage & "注釈数:" & numPageAnnotCnt
##対象ページの注釈を順番に
repeat with itemPageAnnot in objPageAnnot
###注釈
tell itemPageAnnot
###サブタイプを取得して
set strSubtype to subtype as text
###リンク注釈の場合のみ
if strSubtype is "Link" then
###対象の注釈の移動先を取得して
set numDistPage to destination page number as integer
###表紙に戻る場合は
if numDistPage = 1 then
###zoom値を設定する
set zoom factor to 100
end if
end if
end tell
end repeat
end tell
end tell
end tell
end tell
set numChkPage to numChkPage + 1
end repeat
| 固定リンク
« [musicbrainz]アーティスト名+曲名から、アルバム名を取得する(JSON) | トップページ | [Link Annotation]リンク注釈(同一ドキュメント内の他のページビューの移動)Javascript版 »
「Acrobat Annotation」カテゴリの記事
- [Acrobat] 添付ファイルを添付注釈として添付する(2025.01.11)
- [Acrobat]注釈アノテーション一覧出力(コンソール出力用)(2025.01.03)
- [Acrobat]注釈アノテーション一覧出力(AS版)(2025.01.03)
- [Acrobat]コメントによるファイルサイズの増加(2024.10.17)
- [Acrobat]選択した注釈を全ページにコピー(同じ内容の再作成)する スタンプに対応(2024.09.21)