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

Scripting ID Desktop

Guide ,
Jun 13, 2011 Jun 13, 2011

Copy link to clipboard

Copied

Hello,

We have got a plugin that seems to work with InDesign Server.

Is it possible, for testing purposes, to use our scriptable plugin in the desktop application.

I would like to call our plugin from a Safari browser.

P.

TOPICS
SDK

Views

2.3K

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
Participant ,
Jun 13, 2011 Jun 13, 2011

Copy link to clipboard

Copied

Well, it depends. The main question is: do you have sources for this plugin? If you do, then it is possible to lookup the sources and find answer for your first question.

What version of InDesign this plugin is targeted at?

If you want to call plugin code from browser I have only word of warning for you. This is not the kind of integration anyone would like to do.

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
Guide ,
Jun 13, 2011 Jun 13, 2011

Copy link to clipboard

Copied

Hello,

Thank you for your reply.

I have the source code, I wrote it. We are targeting server 4 and 5, ok 3 as well.

When the plugin was tested with InDesign server 4, we did a little bit java script, app.mydata = "xxxxx". The plugin got the data and worked on it.

This was done from a browser application that had already connected to the server. I do not have the browser application. So I am writing a Safari plugin with context menu to send java data to my plugin, trying to emulate the browser application.

I am a bit vague about all of this as I was not there when the test was done.

P.

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 Beginner ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

Provided the plugin has been compiled with { kInDesignServerProduct, kInDesignProduct } in the .fr file rather than only kIndesignServerProduct this should not be a problem. Keep in mind that the scripts you write would probably have to be changed to target the desktop client rather than the server client.

I'm not familiar with Safari plug-ins, but the most common way to script InDesign from OS X is with Applescript. If safari plug-ins supports Applescript code I don't see why this would be a problem.

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
Guide ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

Hello,

Thank you for reply.

I have compiled the plugin with kInDesignProduct as well as server. I have managed to get my context menu working in Safari, well, I pinched some sample code. My problem now seems to be targeting InDesign. If targeting is the right term, ie. getting InDesign to see my script events. I'm using java as the script language.

Thanks.

P.

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
Participant ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

Is it Oracle's Java or JavaScript? Java API (accessible through Scripting Engine) is only available in InDesign Server. No Java for desktop version!

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
Guide ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

Hello, and thank you all for your replies.

I am using JavaScript, so, for my desktop testing I should use Apple Script.

Thank you.

P.

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
Guide ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

Hello,

I have just re-read your reply. Should JavaScript be working on the desktop program?

Thanks.

P.

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 ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

Yes

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 Beginner ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

I'm not sure about this, but wouldn't you need to run the javascripts in ExtendScript Toolkit? Or is it possible to script ID with javascript without using that?

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
Guide ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

Hello,

I thought I would do this from a Safari plugin to try and make my testing as close to the real thing as possible.

The InDesign plugin draws special character attributes and the idea was to be able to switch it on or off from the client application. The client application ( i have not seen it ) is a browser based editorial system. The user can edit stories in the browser and ask the InDesign server for a preview. The preview may or may not have the special character attributes showing.

I suspect the java is getting stuck in Safari. If I use the target attribute the Safari plugin does not load.

Any, it has been interesting and thank you all for your comments.

P.

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
Participant ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

Just a word of warning: InDesign desktop license explicitly forbids any use of InDesign desktop as a server application.

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
Guide ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

Hello,

I think I should abandon this any way, and I take you point about the license.

Thanks.

P.

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 Beginner ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

So let's just see if I understand this correctly. Basically all you want to do is to change some properties of your indesign objects so that the character attributes will be showing when you export pdf/jpegs, but you have no way of doing this via the UI inside InDesign?.

If that's the case, it's quite simple using AppleScript. Basically something like:

tell application "InDesign"

  set my data to "xxxx"

end tell

or perhaps

tell application "InDesign"

  set show attributes of my object to true

end tell

should be enough to change it (exact syntax obviously depends on your scripting definitions). Not sure why you would go through the hoops of creating a safari plug-in for this. I mean the browser client in the production system isn't communicating with InDesign directly, it is using a web service on the server that in turn scripts InDesign.

Maybe I'm missing something.

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
Guide ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

Hello,

That is exactly right, and I have been able to do this by executing a script within InDesign.

I put myself through this HOOP because I know eventually the scripts will be run from a browser application / plugin on InDesign Server.

I suppose really I was curious to know how it was done. I now expect there is some very clever coding going on the browser application.

Thanks again for taking the time to think about this.

P.

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 Beginner ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

I doubt that the InDesign scripting is done from an actual browser application/plug-in. In most cases the browser will communicate with web services on the web server to execute the different changes such as turning on or off flags. The web server is probably a java application that in turn communicates with InDesign via the (server only) Java object API or at the very least uses the Java API to instruct InDesign Server to execute .jsx files. This could also be accomplished similiarly with Microsoft products with some combination of .NET programming, but this is relatively rare in InDesign workflow solutions.

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
Participant ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

Well, probably the whole confusion came from the term "browser application" – is it application used to browse the Web (like Safari or Firefox) or is it application that runs inside the browser (like GMail or Google Docs).

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
Guide ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

As you describe it basically an individual end user will initiate a script on his very own local, licensed desktop machine. Consult a lawyer how far that is covered by the EULA of your InDesign.
Technically, one approach could be:

Safari talks to any webserver on the localhost (i.e. Apache httpd).

In Apache, any kind of CGI - be it Java overkill, be it a simple shell script, receives arguments and forwards them to InDesign.

Google for "shell script cgi" for details.

Here a shell script to invoke InDesign:

#!/bin/sh
osascript << END
tell application "Adobe InDesign CS4"
  do script "alert('Hello, '+arguments[0]);" language javascript with arguments ["World"]
end tell
END

echo "Content-type: text/html"
echo ""
echo "<html><head><title>Test</title></head>"
echo "<body>Done.</body></html>"

Another approach, without any HTTP Server:
CSXS (Flash/Flex based Script plugins) can embedd Webkit. That embedded webkit (Safari) can talk to its ActionScript container via events.
http://livedocs.adobe.com/flex/3/html/help.html?content=ScriptingHTMLContainer_1.html
From ActionScript you can further invoke InDesign's ExtendScript - see the separate CSXS forum for details.
Dirk

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
Guide ,
Jun 16, 2011 Jun 16, 2011

Copy link to clipboard

Copied

LATEST

Dirk,

That is very interesting, thank you.

P.

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