Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Python in InDesign Automation

Enthusiast ,
Jul 12, 2019 Jul 12, 2019

Dear Legends,

We have few clarifications regarding Python language in InDesign Automation.

1. Can we use Python instead of InDesign JavaScripting in InDesign?

2. If 1st point is yes, then how to install Python 3.5 version?

3. Instead of Extend script ToolKit, what we use (Pycharm etc..)?

4. For location we can place in Script Panel or any others?

5. Any InDesign Python tutorials same like as InDesign Scripting Tutorials?

What is the advantages and disadvantages if we go for Python languages in InDesign?

Anyone please help for my request.

Thanks in Advance

Siraj

TOPICS
Scripting
14.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 12, 2019 Jul 12, 2019

Siraj--

There's no official way to use Python with InDesign, but a little googling turns up things like

https://indesignsecrets.com/creating-indesign-scripts-with-python.php

GitHub - lohriialo/indesign-scripting-python: Scripting in InDesign is used to automate a wide varie...

I hope this is helpful.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 12, 2019 Jul 12, 2019

1. Yes, as indeed Google should have shown. InDesign's scripting interface is open enough to be used with any external language that supports the required COM interface.

2. Various Python sites will tell you that for your platform. The official site should suffice.

3. You can use the ExtendScript Toolkit Editor. It will not syntax-check and such (because it's an ExtendScript editor), and obviously you cannot run your Python code. But you can write Python with all plain text editors.

4. Not in the Script panel, and not anywhere else. You cannot "run" a Python script from within InDesign, as it does not support it. You could (theoretically, I didn't try) run a Javascript, VBS, or AppleScript that in turn runs your Python code.

5. No.

I suggested proper Python support in the InDesign Uservoice forum a while ago, nothing new on that front. Perhaps you should vote for it: Add Python to the list of supported scripting languages – Adobe InDesign Feedback

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 15, 2019 Jul 15, 2019

What is the advantages and disadvantages if we go for Python languages in InDesign?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2019 Jul 15, 2019
LATEST

priyak7746321  wrote

What is the advantages and disadvantages if we go for Python languages in InDesign?

The most obvious disadvantage: Python is not natively supported in InDesign.

There are few immediate advantages: "Python is cross-platform, it's easy to learn, and it is powerful" – the latter in the sense of 'having powerful commands', not in the sense of execution speed or something like that. Due to its semi-compiled nature Python may be a smidge faster, but do remember that most of the interactions on an InDesign document will take place inside InDesign, and that will neither run faster nor slower.

"InDesign's DOM can be naturally translated to Python": both have an equivalent (if not straight out equal) system of classes, properties, and methods.

"Python has a vast set of functional libraries": if you need data preprocessed going beyond what InDesign provides, Python can handle that part. It's probably also possible in JavaScript but Python just has vastly more ready-made libraries, due to its popularity in hard science environments.

There is no intrinsic advantage of Python over the currently (properly) supported languages, other than if you already know Python, it will be easier to write a script in that; if you don't know it but you *do* know JavaScript, use JavaScript. (And if you don't know either of these two, better stick to the one that *is* natively supported.)

All of these advantages are, alas, dwarfed by the fact that Python is not natively supported by InDesign.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines