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

Is it possible to auto update InDesign script from cloud?

New Here ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

Hi All,

 

Is it possible to update a script from the cloud once there is a difference in the size of the script?

 

Thanks,

Shonky

TOPICS
Scripting

Views

973

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
Contributor ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

Hi,

 

Kris here. I just tried it out on an M1 Mac with Big Sur and it seems to work fine. However, do note that it won't work unless you run InDesign in Rosetta. I'd need to make a new version that also supports M1. It is on the back burner until I get through my to-do-list for paying customers, which means it might be a long time before I get to it. So, for now, if you're on an M1 Mac, you need to run it with Rosetta.

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
New Here ,
Jul 27, 2021 Jul 27, 2021

Copy link to clipboard

Copied

Thanks but I am on Intel iMac and not on M1.

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
Enthusiast ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

Another idea:
on a mac you can run terminal commands via doScript().
So you probably simply could implement a curl or wget command within a InDesign startup script which downloads the current script file on InDesign startup.
I guess you need to download it anyway to compare it, so I would just replace it, even if there is no change.

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
New Here ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

Thanks Jens but need a solution for Mac and Windows. 

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
Community Expert ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

Your startup script could include both Applescript (Mac) and VisualBasic (PC)  commands to execute depending on the environment the startup script is executing in. 

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
People's Champ ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

It is possible using ExtendScript's socket object, which works fine (http only, though, not https).

You have to create a new Socket object, set the headers correctly, and it's always best to download everything as binary data, so set the encoding to binary.

At this point, you should be able to download what you need and save the downloaded data as a new script file overwriting the previous one.

Ariel

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
New Here ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

Thanks Ariel! Do you have some sample code?

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
People's Champ ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

Sure, something like this (based on Adobe's JavsScript Tools Guide pdf):

reply = "";
conn = new Socket;
// access msn home page
if (conn.open ("www.msn.com:80")) {
// send a HTTP GET request
conn.write ("GET /msn.com/ HTTP/1.0\r\n" + "Host: www.msn.com\r\n\r\n");
// and read the server’s reply
reply = conn.read(999999);
conn.close();
}
alert(reply);

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
New Here ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

Reply is blank, I tried Adobe as well but not receiving any output. 

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
LEGEND ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

Blank is the correct result. You do need to understand the basics of the HTTP protocol. There is no page at www.msn.com/msn.com, so you should see an error returned, however, the script does not check for one. Just use the script as a starting point, copy/paste is not enough.

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
Community Expert ,
Jul 18, 2021 Jul 18, 2021

Copy link to clipboard

Copied

Hi @Shonkyin1,

As I already mentioned if you go by the route that Ariel mentioned you need to understand the nitty-gritty of HTTP protocol, there is no magic bullet here that you can just use and get your job done. The facts remain the same

  • ESTK does not have any implementation for HTTP/HTTPS calls. You just have a socket object to start with.
  • You could use the C++ DLL/framework route of extending the capabilities of ESTK. A sample of this is Kris's solution that you tried.
  • Create a C++ SDK plugin for InDesign
  • Use Applescript/VBscript
  • Or use a separate application written in something like NodeJS, Python and probably launch these applications from within jsx using something like File.execute method

-Manan

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