How to require or include scripts in indesign?
How do I load another script file and run a method on it?
I’m using InDesign javascript and I don’t know how to include multiple files in the same script.
2 Answers 2
Three options: import, app.doScript, and $.evalFile. I prefer $.evalFile. See app.doScript vs $.evalFile
Working Example:
C:\script1.jsx
C:\script2.jsx
If script2.jsx is not located in the root of the C drive, modify script 1 with its true location.
Как установить скрипты в Indesign. Быстрый обзор скрипта DoTextOk
Если вам понравилось бесплатно смотреть видео как установить скрипты в indesign. быстрый обзор скрипта dotextok онлайн которое загрузил Кир Витковский. О дизайне и околодизайне. 29 июня 2021 длительностью 00 ч 16 мин 24 сек в хорошем качестве, то расскажите об этом видео своим друзьям, ведь его посмотрели 5 003 раза.
Julia O
Добрый вечер. Подскажите, а переносы вы расставляете после применения этого скрипта, верно? А также подскажите, переносы ставятся автоматически (т.е. "штатными" возможностями Индиза), скрипт для этого никакой не применяется, верно?
И еще один доп. вопрос — есть ли и какой скрипт для работы со сносками, предстоит верстка с обилием сносок. Спасибо!
натаШа фурсик
Отлично, сегодня и попробовать скрипт есть повод) спасибо за видео
Taylor Momsen
к сожалению, висячие строки плохо убирает
Краснухина Лариса
Oleg Shakirov
Спасибо, Кирилл, замечательно! Я раньше пользовался гораздо худшим скриптом, и, тому же, платным.
Rent Expo LLC
Мария Невмержицкая
Кирилл, вопрос: отчего скрипт при обработке текста красит текст с жирным начертанием в красный цвет? Причем выборочно.
О_о
Андрей Гирка
С 2012 года млн и млрд пишется без точки. Как всегда у нас в правилах чёрт ногу сломит — не правила, а сплошные исключения.
GoldNotGod
Какой скрипт мне поможет перенести 100 страниц книги из ПДФ в Индизайн, так что б в Индийзайне он был текстом, а не картинкой.
Ilya Kudriashov
Запускать надо через Use Current Set, так? А какой из имеющихся сейчас current? И можно ли менять настройки? или надо открывать и сохранять новые? Как проверить, какие настройки сохранены?
Ilya Kudriashov
он работает с английскими или французскими текстами? Там есть опция "статья на английском". Она про это?
Mary Khosman
Спасибо большое!
Да, было бы здорово послушать подробнее.
Zoomfilm 41
Слишком громко, надо тише.
Севда Багирова
Спасибо, всегда очень интересно!
Sergey Kostyurov
У DoTextOK действительно какая-то беда с табуляторами. В остальном же — сверхполезный инструмент. Как вспомню, сколько времени уходило на верстку первых книг как раз по причине удаления висячих предлогов. А потом передвигали фотографию, и все приходилось начинать сначала.
Пробовал правила устанавливать внутри стилей, но компьютер просто замирает. Так что, пользу данного инструмента переоценить очень сложно.
MsBorisKV
Очень ценные практические советы по верстке. Спасибо.
Кирилл Ратов
Класс! Пользуюсь этим скриптом. Хотелось бы еще более подробней услышать об этом и других скриптах.
Михаил Иванюшин
На первой вкладке есть флажок замены табуляций на пробелы.
С ним повторяющиеся табуляции исчезают.
InDesign scripts

InDesign Scripts are code of computer language that helps us perform various tasks in just a few simple steps. We can perform simple and complex tasks with specific scripts, and we have a number of built-in scripts in InDesign under the Scripts panel. The coolest thing about the script of this software is that you can create your own scripts or run scripts created by other people for having a result of your desired task. Here in this article, I will tell you how you can use different scripts of script panel in this software and also tell you how you can install any script from external sources.
How to use Scripts in InDesign?
To start using scripts in this software, you need not worry about it. It is very simple to work with it and use it to have our desired result. So let us start our discussion.
3D animation, modelling, simulation, game development & others
I will start our discussion by taking a new document. I will choose this Letter size document from the New Document dialog box of this software.

Here at the right side of the user interface of this software, we have a panel section, and in this section, we can find the Script panel.

You can also navigate this panel in the Window menu, so click on the Window menu and go to Utilities option of scroll down list. Here in the new scroll-down list of Utilities options, we can find this panel. Ctrl + Alt + F11 is the shortcut key for enabling this panel on our working screen.

Now let us take the rectangle tool, and I will create this rectangle. I will click on the dropdown arrow button of the Application folder of the Scripts panel, and we have the Sample folder in it.

Now click on the dropdown arrow button of the Samples folder, and in it, we have JavaScript and VBScript. You can use the script of any of them.

I will open the JavaScript folder, and you can see there is a number of the script in this list.

If you want to use any one of them, you have first to select the object on which you want to apply the chosen script, go to the Scripts panel, and double click on your desired script. I will show you this by example. I will first select this rectangle and click on the AlignToPage script of the JavaScript.

We use this script to align objects in a different manner, such as; you can see there are some options in the panel of AlignToPage script. But, again, I will go with default options this time; it will align our chosen object with the top left corner of the page.

Once I click Ok, it will align like this, but I want to align it with the margin area.

So I will again open this align script panel and enable this ‘Consider Page Margin’ option.

Now, if I click Ok, then it will align with the top left corner of the margin of the page.

Now let me tell you one of the scripts which we can use for text. When we paste text in the text frame of InDesign given by the client, we face many text formatting errors such as there may be an unnecessary gap, hyphens, tabs space, and so on. So with the next script, we can resolve it.
I have pasted this text in the text frame of this software, and you can see it seems this text is perfectly arranged.

Let me enable hidden characters, and we can enable it from the ‘Show Hidden Characters’ option of the scroll-down list of Type menu.

Now you can identify there are unnecessary gaps, hyphens, and tabs. To resolve this, we can double-click on the ‘FindChangeByList’ script.

Once we make a click, it will ask, you want to apply this on a document only or selected story. For this time, I will go with the Document option and click Ok.

And you can see it resolve all formatting issue, and the text is perfectly arranged according to the type format.

What if you want to have your own script or want to use the downloaded script from an external source? You can also have this in the Scripts panel also, and it will come under the User folder of this Scripts panel, but if you haven’t any external script, then the User folder will be empty.

Let me tell you how you can have your desired script here. First, make right-click on the User folder and click on Reveal in Explorer option.

Once we click on this option location, a Scripts Panel folder of InDesign will open.

You can paste the script code of your desired script here in this folder. For example, I have downloaded a script from the internet and past it in the Scripts Panel folder. You can also paste your own written script code if you know about the Java language.

Now you can see there is our downloaded script in the User folder.

This script is for drawing waves for different data types if you create a design layout for any analysis. But, first, I will take the Frame tool from the tool panel to explain it.

And draw a frame like this because our wave will fit in this frame. So after drawing this frame, I will make double click on this DrawWave script.

Once I click, this panel will be open. Here we can set a number of waves, phases, and cycles. For example, I will enter the value of a number of waves as 2 and leave the rest parameters the same, then click on the Ok button.

And it will create a wave form like this.

Now I will make some changes in parameters like this.

And you can see according to parameters; it gives a different result.

You can change the colors of waves also.

Conclusion
So now you know how you can interact with the built-in script of InDesign and perform any task by using them. In addition, in this article, you learned how to insert your own or downloaded script in the Script panel of this software for using them in your design layout.
Recommended Articles
This is a guide to InDesign scripts. Here we discuss How to use Scripts in InDesign along with the step-by-step in detail. You may also have a look at the following articles to learn more –
Как загрузить скрипт в индизайн
Добавлено:
"Из палитры Scripts скрипт запускается, а устанавливаются скрипты помещением их в папку
Adobe InDesign CS2 > Presets > Scripts "
Спасибо, сейчас в ту папку положила скрипт и он появился в программе, но не работает, когда я нажимаю на него.
"Палитра Scripts открывается:
Window > Automation > Scripts"
Вот только у меня в этой вкладке Scripts нет
Scripts есть во вкладке Window просто. Я его оттуда включила, но он почему-то не работает.
Раньше надо было просто выделить текст и нажать на скрипт, а теперь когда так делаю, то выходит табличка
"Невозможно создание объекта контейнером ActiveX:InDesign.Application.CS2"-2146827859
Это значит что моя версия InDesign Слишком стара для этого скрипта?
Цитата:
| Scripts есть во вкладке Window просто. |
Ну значит в CS так, я давно им не пользовался и у меня его сейчас нет.
Цитата:
| Скачала из интернета скрипт, который так же должен текст обрабатывать : placeText.jsx |
Откуда именно? Скорее всего та же проблема, скрипт для новой версии InDesign.
По идее должен работать в CS, попробую проверить
И видеть должен в любом случае, если скрипт лежит в папке Scripts.