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

Snippet idms thumbnails

Explorer ,
Mar 13, 2012 Mar 13, 2012

Hello everyone,

I'm a really new user in InDesign scripting, and I'm looking for a solution to generate an image (.jpg file for instance) from a snippet (.idms or .idml file), in command line, in order to launch this command from a website page. I already look in InDesign docs but I didn't know where to start : InDesign script, Server, maybe a solution with Bridge...

After that (maybe not right now), I wanted to be able to add parameters to this utility : a title, an image path..

Thanks all for your help, or if you know an equivalent solution.

TOPICS
Scripting
7.2K
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
LEGEND ,
Mar 13, 2012 Mar 13, 2012

By default, InDesign saves a preview of the snippet in an idms file. You can extract that and save as an image file.

You should look for the content inside the <xmpGImg:image> tag.

Harbs

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 ,
Mar 13, 2012 Mar 13, 2012

Thanks Harbs for the answer. It's a really good start.

Now I would like to dynamically interact with this idms : change text, add an image,.. and so update this idms file to get new preview.

Maybe some InDesign scripts can do that

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
LEGEND ,
Mar 15, 2012 Mar 15, 2012

Now I would like to dynamically interact with this idms : change text, add an image,.. and so update this idms file to get new preview.

Maybe some InDesign scripts can do that

Well, you have two choices.

You can sit down with the IDML specification and determine how to manipulate the XML file directly.

Or you can do it as you would do it in InDesign: Open a new document, place the IDMS file, edit the document, and export to IDMS.

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 ,
Mar 16, 2012 Mar 16, 2012

That's exactly what I have done : create new document, place my IDMS file, load datas from easycatalog, and export to jpeg file.

My script is fine, now I'm looking for the best way to call this .jsx from my PHP code and passing few arguments

Thanks for your help !

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
LEGEND ,
Mar 16, 2012 Mar 16, 2012

My script is fine, now I'm looking for the best way to call this .jsx from my PHP code and passing few arguments

Uhoh.

PHP? We need a lot more information! Is this running on a web server? Is the web server running InDesign? Or is it some other arrangement? What operating system?

You now have two major problems, one technical and one political.

The technical problem is how you call InDesign's Javascript from PHP. The answer is OS-specific, and probably involves AppleScript (or Scripting Bridge and AppleEvents) on a Mac, or VB (COM+/.NET, and more TLAs no doubt) under Windows.

But the political problem is likely Insurmountable. InDesign's EULA prohibits automated scripting of the application from a web server. So if that's what you're trying to do, unless you have determined that the EULA does not apply to you, you have a problem.

One solution to this is to purchase InDesign server, which can get you a EULA that permits this. This is in the teens of thousands of dollaris ($USD) though, I believe, which makes it impractical. (By "teens" I mean between USD$10,000 and USD$19,999, and I really don't remember the pricing.)

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 ,
Mar 16, 2012 Mar 16, 2012

Sorry for my lack of details !

I try to find a way to launch from a command line from a Unix Server.

First in InDesign on local on my mac, but after with InDesign Server (I have a licence, don't worry !)

So I'll try an AppleScript. Do you know a solution to pass arguments to my script with appleScript ?

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
LEGEND ,
Mar 16, 2012 Mar 16, 2012
LATEST

Well, the baseline example would be:

osascript -e 'tell app "Adobe InDesign CS5" to do script "alert(33);" language javascript'

to pass a JS expression, alert(33);, to InDesign. I believe you can also pass a file path, and there is a "with arguments" form (check the dictionary). Just watch your quoting.

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