简体   繁体   English

将ExtendScript添加到Indesign中的按钮

[英]Add a ExtendScript to a button in Indesign

Well the title pretty much explains the problem. 那么标题几乎可以解释问题。

I have a InDesign document containing buttons. 我有一个包含按钮的InDesign文档。 One of the buttons should go back to the page the user comes from (previous page). 按钮之一应返回到用户来自的页面(上一页)。 So I want to create a var containing the value of the pagenumber on the button on the previous page like this: 所以,我想创建一个var包含在这样前面的页面上的按钮,页面编号的值:

var prevPage = this.pageNum;

Then on the button that should get the user back to where he came from add this: 然后在应该使用户回到其来源的按钮上,添加以下内容:

this.pageNum = prevPage;

This works if I do this after the PDF is created. 如果我在创建PDF后执行此操作,则此方法有效。 But since this is a time consuming hassle to do every time the client makes corrections I would like to do it in InDesign. 但是,由于每次客户进行更正都是一件耗时的麻烦事,因此我想在InDesign中进行。

I know I can add an action to the button containing a menu-action "go to previous page". 我知道我可以向包含菜单动作“转到上一页”的按钮添加动作。 This literally goes through the Acrobat menu and takes you to the previous page. 这实际上是通过Acrobat菜单进行的,并带您到上一页。

The problem is that the Acrobat app doesn't have that menu. 问题在于Acrobat应用程序没有该菜单。 So the action can't find the menu items and won't work. 因此,该操作无法找到菜单项,因此无法正常工作。

I would like to add a script to the button... but seriously wondering if this is possible. 我想在按钮上添加一个脚本...但是认真地想知道这是否可行。 I couldn't even find a plugin that does this. 我什至找不到能做到这一点的插件。

Hope the stack-brothers have a solution. 希望兄弟姐妹们有解决方案。

Use the script below for the button action. 将以下脚本用于按钮操作。 It to the previous view on the view stack, which is equivalent to clicking the Previous View button on the Acrobat toolbar. 它到视图堆栈上的上一个视图,等效于单击Acrobat工具栏上的“上一个视图”按钮。

app.goBack();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在InDesign [ExtendScript]中选择,调整和分发文本框架 - Select, adjust and distribute textframes in InDesign [ExtendScript] 如何在Adobe Indesign的extendscript中定义换行符 - How to define a line break in extendscript for Adobe Indesign 在indesignextendscript中循环遍历Xml元素 - looping through Xml elements in indesign extendscript 将Applescript列表作为Indesign数组传递给javascript ExtendScript - Passing Applescript list to javascript ExtendScript as array for Indesign 使用 Extendscript (JavaScript) 以增量方式更改 Indesign 色板 - Changing an Indesign Swatch incrementally with Extendscript (JavaScript) 使用Extendscript在InDesign中放置文件时指定编码 - Specifying Encoding While Placing Files In InDesign Using Extendscript "是否可以使用 CEP\/ExtendScript\/JS 检测 InDesign 中的页面更改?" - Is it possible to detect the change of page in InDesign using CEP/ExtendScript/JS? 如何在InDesign中使用ExtendScript更改彩色灰度图片的色样? - How to change color swatch of colored greyscale pictures using ExtendScript in InDesign? Extendscript InDesign CS6:使用打印预设进行打印 - Extendscript InDesign CS6: Print using a print preset Indesign javascript 错误:模态对话框或警报处于活动状态 adobe extendscript 工具包 - Indesign javascript ERROR: MODAL DIALOG OR ALERT IS ACTIVE adobe extendscript toolkit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM