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

Getting data from an API

Explorer ,
Nov 25, 2020 Nov 25, 2020

Copy link to clipboard

Copied

Hello,

I realise this is somewhat bleeding edge use case but in theory, would it be possible to call an external API from an Illustrator script?

For example getting holiday data from this library https://github.com/commenthol/date-holidays

If possible, how would you go about it? Is there a similar example somewhere I could study?

Many thanks.

TOPICS
Scripting

Views

904

Translate

Translate

Report

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

correct answers 1 Correct answer

Valorous Hero , Nov 25, 2020 Nov 25, 2020

Votes

Translate

Translate
Adobe
Valorous Hero ,
Nov 25, 2020 Nov 25, 2020

Copy link to clipboard

Copied

Yea, there were many solutions to this rare but not uncommon question. You could have used super-easy-to-use Bridge code and Adobe Bridge running to perform a nice synchronous web call all within extendscript. But, then one year Bridge 2016 had a bug in its scripting to where this feature quit working. And it quit for one of my customers so they were in a bind as that's how they were performing their web calls to produce their wares daily, otherwise they would have to go copy stuff from the browser for hours. So, they were able to quickly work around this by reverting back to the previous Bridge until Adobe ended up fixing the bug. Which lasted about a good 2 years and then the same thing happens. Or something is changed and this basically doesn't work for web calls anymore.

So, I just changed over to using OS scripts such as AppleScript or VBS for Windows to send web calls and also pass those results to the JSX scripts. Some of us have used a method of executing an os script from a jsx script and waiting with .sleep() intervals for a certain duration while monitoring some location where the results of the web call would be written down in a text file. I write my jsx scripts as functions which can be runnable from external os scripts so that this process is chained, but that process still uses a text file to write down the url and also if there was a UI dialog in Illustrator, it disappears and then comes back populated with web-call results but this lets the user move their mouse around and do stuff in the document for a few moments.

So, yea there's ways to do web calls but it's not out-of-the-box.

Votes

Translate

Translate

Report

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
Valorous Hero ,
Nov 25, 2020 Nov 25, 2020

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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 ,
Nov 26, 2020 Nov 26, 2020

Copy link to clipboard

Copied

LATEST

Thanks for the pointers. Will have a look.

Votes

Translate

Translate

Report

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