How To Export Text From Adobe Illustrator and Photoshop To Notepad?

How To Export Text From Adobe Illustrator and Photoshop To Notepad?

A Short Tutorial on Text Extraction From Adobe Illustrator & Photoshop Into Notepad.

THE PROBLEM

As a graphic designer, during extensive typing work, there comes a time when you want to copy-paste a large pile of text from the layers or artboard. It is indeed a massive, time-consuming job to manually copy each word or sentence layer by layer. So you might wonder how would you:

  1. Keep yourself relaxed while typing.
  2. Extract out all the text within just a few clicks.
  3. Automatically save the extracted text in a notepad file.

THE RESEARCH

Chris Pine, a programmer, once said,

“Programming isn’t about what you know; it’s about what you can figure out.” — Chris Pine¹

I was also facing the same problem, so I searched for any scripted code on Google. Luckily, I found a ready-made 21 years old script written by Bramus, a Freelance Web Developer from Belgium. I followed the steps he defined in his blog PS_BRAMUS.TextConvert: PSD2TXT and TXT2PSD for the masses ², and the script worked perfectly for Adobe Photoshop.

Unfortunately, I thought it would give me the same results for Adobe Illustrator, but it raised an error, as shown in the snapshot below.

Snapshot of Error Dialog in Adobe Illustrator.

I wasn’t about to give up yet; it became clear that Illustrator & Photoshop’s layer types function differently from each other after analyzing the error. As shown in the below figure, a graphic designer rarely uses any layer in Adobe Illustrator because he can perform all the text editing actions using an artboard.

Text Editing using Artboards in Adobe Illustrator.

On the other hand, Adobe Photoshop supports multiple layers to work in a cleaner environment. It’s easier to handle complex data and edit each object separately within a single layer; refer to the below image.

Text Editing using Layers in Adobe Photoshop.

One of the disadvantages of Adobe Photoshop is that it doesn’t produce vector graphics; that’s why graphic designers prefer to use Adobe Illustrator over it.

Being a programmer is fruitful. I tweaked the code from the script, and it exported the text from Adobe Illustrator into Notepad perfectly within just a few seconds.

THE SOLUTION

Moving towards the solution, you can now export your written text from Adobe Illustrator and Photoshop into Notepad by downloading the GitHub Repo Text Extraction From Adobe Illustrator & Photoshop To Notepad³ as ZIP.

Navigate to the “Download Zip” option.

Exporting Text in Adobe Illustrator

  1. Close Illustrator and extract the IllustratorTextExtractor.jsx file inside the Scripts folder.

C:\\Program Files\\Adobe\\Adobe Illustrator 2021\\Presets\\en\_US\\Scripts

2. Open up the Test.ai file and navigate to File/Scripts to execute the script.

Script Navigation in Adobe Illustrator.

Exporting Text in Adobe Photoshop

  1. Close Photoshop and extract the PS_Bramus.TextExportWithUTF-1.3.jsx file inside the Scripts folder.

C:\\Program Files\\Adobe\\Adobe Photoshop 2021\\Presets\\Scripts

2. Open up the Test.psd file and navigate to File/Scripts to execute the script.

Script Navigation in Adobe Photoshop.

RESULT

After a successful export, your text would pop up in Notepad. Change the text alignment from left to right to view the Urdu text correctly.

Changing Text Alignment in Notepad.

FUN FACTS

Below are some interesting facts that you can try out.

  1. To change the order of the text, switch the layer order.

Layer Switching in Adobe Illustrator & Photoshop.

2. Open up multiple files & export them within a single click as shown in the below image.

Multiple File Export Support.

3. Run the scripts with other languages by changing the file encoding; refer to the below snippet.

fileOut.encoding = “UTF-16”; // Change it to UTF-8 or UTF-32.

If you found this article helpful, kindly share your thoughts and hit the reaction button.

ACKNOWLEDGEMENT

Thanks to Bramus for sharing the script code on GitHub4.

REFERENCES

[1]: Programming Wisdom on Twitter https://twitter.com/codewisdom/status/927959286017294336?lang=en

[2]: PS_BRAMUS.TextConvert: PSD2TXT and TXT2PSD for the masses! — Bram.us https://www.bram.us/2008/10/30/ps_bramustextconvert-psd2txt-and-txt2psd-for-the-masses/

[3]: Text Extraction From Adobe Illustrator & Photoshop To Notepad | GitHub Repo https://github.com/Zujaj/Text-Extraction-From-Adobe-Illustrator---Photoshop-To-Notepad.git

[4]: PSD2TXT and TXT2PSD for the masses | GitHub Repo https://github.com/bramus/PS_BRAMUS.TextConvert.git