Script for skipping to next page (of imported pdf/ai/ind)?





Hey Community and scripting gurus,

 

i've done this in applescript for pdf, but im on a pc now and still struggeling with java. Tho I guess someone done this before, it seems so obvious to have:

Im looking for a script to skip to next page, of a placed multipage-document. 

 

As im thinking about it: at a basic level, what also can work would be a script to reload the linked document, with import-options shown.

 

But then I need to know exactly which page was imported, and with that small preview-section-window it can be quite difficult to find, if you only go by visual. Also i discovered - while having these lack of any programming skills - that there is (maybe) no way to tell the max-count of pages of placed documents within the InD-DOM, to not skip into an non-existing pages at the eof and I ended up calling Acrobat for that (which is mostly running anyway), than skip to the first page again.

 

**I dream of a script** which can skip to next page for placed PDFs, AIs and InDesign-docs. If the last page is shown, it should skip to first page. In the top of the scripts code can be a variable to reverse the order to backwards skipping, so I can save a second version and keybind both scripts, if I want to use the previous page. Also nice if you have skip too far ahead and the doc is large. 

 

Anyone got this laying around or is saying "pfff EZ - giv me 4 mins" it would be very appriciated!
Hi Jan,


years ago John Hawkinson did a script that would invoke the place options on an already placed PDF, InDesign page or AI file, I think. Hope, I can find the old thread or the ExtendScript code. You could build on this. But be warned: Not all PDFs would show how many pages are inside. At least you cannot see this by scripting.


 


Ah. Found the extended script I did, based on John's original one:


 


 



```
// PlaceAgain-PlaceOptionsShowing-SELECTION.jsx
// Uwe Laubender

//DESCRIPTION:Select a placed image, PDF or InDesign document to replace it with itself getting options

/**
* @@@BUILDINFO@@@ PlaceAgain-PlaceOptionsShowing-SELECTION.jsx !Version! Fri Sep 09 2016 14:09:53 GMT+0200
*/

/*
	Posted in this thread at Adobe InDesign Forum:
	"Toggle pages of a linked Indesign document inside Indesign?"
	mmackinven | Sep 9, 2016
	https://forums.adobe.com/message/8993859#8993859
	
	You can either select the placed file directly or its container frame.
	Or, if its part of a group, the group itself.
	Or, if the container frame is pasted inside another object, that object.
	
*/

placeAgainSelection();

function placeAgainSelection()
{
	if(app.documents.length == 0){alert("ERROR"+"\r"+"No document is open."); return};
	if(app.selection.length != 1){alert("ERROR"+"\r"+"Select one single item containing a placed file."); return};

	// The placed object is selected:
	if
	(
		app.selection[0].constructor.name == "ImportedPage" || 
		app.selection[0].constructor.name == "PDF" ||
		app.selection[0].constructor.name == "EPS" ||
		app.selection[0].constructor.name == "Image" ||
		app.selection[0].constructor.name == "PICT" ||
		app.selection[0].constructor.name == "WMF"
	)
	{	
		var graphic = app.selection[0];
	};
	
	else if(app.selection[0].allGraphics.length == 0){return};
	
	// The container of the placed object is selected:
	else{var graphic = app.selection[0].allGraphics[0]};

	// Two important checks:
	// Case 1: Graphic was pasted on the page from e.g. PhotoShop:
	if(graphic.itemLink == null){alert("ERROR"+"\r"+"The graphic was pasted on the page. The original file cannot be found.");return};
	// Case 2: Link is not available, because placed graphic was renamed, removed or otherwise is not available:
	var file = File(graphic.itemLink.filePath);
	if(!file.exists){alert("ERROR"+"\r"+"\""+file.name+"\""+"\r"+"File cannot be found."); return};
	
	// If you cancel the place options dialog, no error will be thrown:
	try{
	graphic.place(file,true);
	}catch(e){};
};
```

 


 


**Important Note:**


The original thread from 2016 where I posted the script code did not make it to the new InDesign forum.


 


Because of that this thread where I mentioned my script is rendered useless:


[https://community.adobe.com/t5/indesign/swapping-pages-of-a-linked-file-indesign-file-without-replac...](https://community.adobe.com/t5/indesign/swapping-pages-of-a-linked-file-indesign-file-without-replacing-the-file-and-choosing-the-page/m-p/10403771?page=1)


 


This one as well, but there is also a link to a script by Roland Dreger that could be useful:


<https://community.adobe.com/t5/indesign/linked-ai-file-change-artboard/m-p/10444575?page=1>


 


Regards,  
Uwe Laubender


( ACP )
in your for each activity, assign the output variable:

[foreachloop]

then in your file path it would be something like:

“c:\users%youruser%\desktop\uipathdemo\pdf\extractedpages” + %outputvariable.tostring% + “.pdf” this is much easier to do than it sounds. if you have adobe pdf reader downloaded and installed in some format on your computer, all you have to do is follow a few quick instructions. first, you open the pdf in adobe. then, you click i got in touch with pdftron support by opening a ticket. it seems as though the page transition options are disable when viewing a document with 1000+ pages. this explains why the options disappear since the document i have been trying to view was about 1500+.

thanks, everyone for the help 介紹你使用「pdf split and merge 」這款軟體！

請參考以下的介紹：

「阿榮福利味」的介紹：

http://azo-freeware.blogspot.com/2007/11/pdf-split-and-merge-07sr1.html

落腳齋的介紹非常詳細：

http://wuyy.idv.tw/blog/index.php/20070206/

這是pdf split and merge 的官方網站：

http://www.pdfsam.org/

免費又好用，

我已用了好幾次，

且有中文畫面，

容易上手。 Put the grid inside a panel (rather than scrolling the grid itself) and the following in the head section of the page. This is set for using a MasterPage, but you can remove the "ctl00\_MainContentPlaceHolder\_" prefix for a regular page.  

  

XMLCopy Code

```
<script type="text/javascript" language="javascript">
        window.onload = function () {
                var strCook = document.cookie;

                if (strCook.indexOf("!~") != 0) {
                        var intS = strCook.indexOf("!~");
                        var intE = strCook.indexOf("~!");
                        var strPos = strCook.substring(intS + 2, intE);
                        document.getElementById("ctl00\_MainContentPlaceHolder\_pnlFindings").scrollTop = strPos;
                }

        }
</script>
<script type="text/javascript" language="javascript">
        function SetDivPosition() {
                var intY = document.getElementById("ctl00\_MainContentPlaceHolder\_pnlFindings").scrollTop;
                document.cookie = "yPos=!~" + intY + "~!";
        }
</script>
```
  

  

In the Panel, you'll need:   

 onscroll="SetDivPosition()"  

  

That should do it for you. Works for me, anyway. You can detect the browser in use and display the message. You can even have it hide the page content unless the browser used is Internet Explorer. However, there's no way to use JavaScript (or any other web dev. code) to open a completely separate program.



If you are really determined, you might try looking into something that indirectly opens another program through an object or applet of some kind, like flash or Java applets. I don't think you'll find anything, though.



If this were possible, it would be a security problem. Consider the situation if IE had a known exploit and it were possible to force a page to open in IE regardless of the browser it was originally opened in.



I recommend fixing your site. It's not that difficult to develop pages that work everywhere. If I develop pages in accordance with the W3C recommendations, they work pretty well in Firefox, Safari, Opera, and Chrome. Then it's not too difficult to tweak them to work in IE. I've found that doing it the other way around, targeting IE first then tweaking it to work in other browsers, is much more difficult. Pages that require Microsoft ActiveX plugins are an exception of course, but I think it's well worth the time to find an alternative.



--  

-- Ghodmode use sections. the first page should be section 1. you can assign the master page elements to that section only. then all other pages will be in section 2, with a different master page with different elements. each section can pick up page numbering from the last or start at a new number. you need a macro. a small extract of the four sheets may be uploaded to 
  
www.speedyshare.com without password. hi spacing,
 


 upgrading to premium will allow you to annotate pdfs, including highlighting text, however there isn't a way for that highlighted text to be extracted from the pdf using evernote. a quick google search is showing a few third party applications that have the ability to do this (sumnotes and skim were a couple i found), but i haven't tested them out myself. hope that helps! [image] sgenter:

is there another way to zip off a chapter with the new version of bookdown? alternatively, how would i revert to the previous version?

this is a pretty specific use case and don't know yet about. so i don't think you can "zip" the way you want

[image] sgenter:

i do reali…