Opening multi-page PDFs in Illustrator

Hi there

First post, so please be patient and kind…

I have hundreds of multipage PDF files that I need to edit in Illustrator CC. I have the editing part sorted but am struggling to open the PDFs with the page range option set to “All” and the “Import PDF pages as links for optimal performance” un-checked. I can specify and open a specific page using the script below however I need to open all pages, which I understand created a new “untitled” file but I can get the name to as it with from the open command…

Please help

set chosenfile to (choose file)
tell application “Adobe Illustrator”
set user interaction level to never interact
set page of PDF file options of settings to 1
open chosenfile as alias without dialogs
end tell

Per the documentation (for CC 2017), there is no ‘all’. The page must be an integer.

FWIW, I’m not really sure what it would mean to use ‘all’ when opening a document, as this seems to be which page should the document be on — as in, ‘I opened the book to page 20’. What is it that you’re trying to accomplish?

I think you had most of what you needed…

set chosenfile to (choose file)
tell application "Adobe Illustrator"
	set user interaction level to never interact
	--set page of PDF file options of settings to 1
	set page range of PDF file options of settings to "all" --this will open all pages. You may also specify a page range. From the library: page range (text) : Range of pages when opening a multipage document [possible values: 'all', range(for example: '1,2,3-5,8')]
	open chosenfile as alias without dialogs
end tell

Andrew