Automator PDF結合時にエラー127がでる
PDF結合時にエラー127がでます。ここ数年は何も問題ありませんでした
* タイトルを変更しました。 Apple Inc.
MacBook Air (2020 or later)
Apple サポート App および YouTube チャンネルのお知らせ
* iOS 向け Apple サポート App のバージョン 5.6 が公開されました。
* YouTube - Apple Japan チャンネルで有用なヒントや使い方を配信中です。
* iOS 向け Apple サポート App のバージョン 5.6 が公開されました。
* YouTube - Apple Japan チャンネルで有用なヒントや使い方を配信中です。
コミュニティでの投票について
コミュニティでの投票について解説した記事を公開しました。
コミュニティでの投票について解説した記事を公開しました。
Apple Account (Apple ID) の不正利用を確認する方法
Apple Account に関するよくある質問についてはこちらのページを、また不正利用を確認する方法についてはこちらのドキュメントをご参照ください。
Apple Account に関するよくある質問についてはこちらのページを、また不正利用を確認する方法についてはこちらのドキュメントをご参照ください。
PDF結合時にエラー127がでます。ここ数年は何も問題ありませんでした
* タイトルを変更しました。 Apple Inc.
MacBook Air (2020 or later)
情報ありがとうございます。ご紹介のページには「AppleScriptObjC は使えないようでした」とありますが、大丈夫のようですよ。こんな感じで作ってみました。
ショートカットを実行するとダイアログが二回表示されます。最初のダイアログで PDF ファイルを複数選択し、二つ目のダイアログで結合後のファイルの名前と場所を指定。
use AppleScript version "2.8"
use scripting additions
use framework "PDFKit"
property OSX : current application
property nil : missing value
on run
set uti to "com.adobe.pdf"
set msg to "PDF ファイルを選択してください。"
set args to choose file of type uti with prompt msg with multiple selections allowed
set pdf to OSX's PDFDocument's alloc()'s init()
set idx to 0
repeat with f in args
set furl to (OSX's NSURL's fileURLWithPath:(f's POSIX path))
set doc to (OSX's PDFDocument's alloc()'s initWithURL:furl)
repeat with i from 1 to doc's pageCount()
(pdf's insertPage:(doc's pageAtIndex:(i - 1)) atIndex:idx)
set idx to idx + 1
end repeat
end repeat
set fpath to choose file name default name "out.pdf" default location (path to desktop)
if pdf's writeToFile:(fpath's POSIX path) then
return fpath as text
else
error "failed to write to file \"" & fpath & "\""
end if
end run
動作確認: Parallels Desktop 17 上の Monterey 12.3
情報ありがとうございます。ご紹介のページには「AppleScriptObjC は使えないようでした」とありますが、大丈夫のようですよ。こんな感じで作ってみました。
ショートカットを実行するとダイアログが二回表示されます。最初のダイアログで PDF ファイルを複数選択し、二つ目のダイアログで結合後のファイルの名前と場所を指定。
use AppleScript version "2.8"
use scripting additions
use framework "PDFKit"
property OSX : current application
property nil : missing value
on run
set uti to "com.adobe.pdf"
set msg to "PDF ファイルを選択してください。"
set args to choose file of type uti with prompt msg with multiple selections allowed
set pdf to OSX's PDFDocument's alloc()'s init()
set idx to 0
repeat with f in args
set furl to (OSX's NSURL's fileURLWithPath:(f's POSIX path))
set doc to (OSX's PDFDocument's alloc()'s initWithURL:furl)
repeat with i from 1 to doc's pageCount()
(pdf's insertPage:(doc's pageAtIndex:(i - 1)) atIndex:idx)
set idx to idx + 1
end repeat
end repeat
set fpath to choose file name default name "out.pdf" default location (path to desktop)
if pdf's writeToFile:(fpath's POSIX path) then
return fpath as text
else
error "failed to write to file \"" & fpath & "\""
end if
end run
動作確認: Parallels Desktop 17 上の Monterey 12.3
OS のバージョンが不明ですが...、もし Monterey 12.3 なら下記が参考になると思います。
MacOS 12.3 (Monterey) Automator Combine P… - Apple Community
Monterey 12.3で自分もエラー127になりました。
下記のブログで原因についてと替わりとなるPDF結合方法を紹介してくださっており参考になると思います。
Monterey 12.3 だったら Finder で PDF ファイルを選択して「副クリック > クイックアクション > PDFを作成」でいけると思います。
Automator PDF結合時にエラー127がでる