Skip to main content
Inspiring
December 7, 2009
Question

Place image and centre javascript??

  • December 7, 2009
  • 2 replies
  • 607 views

Hello,

I'm trying to create a script (Javascript) which automatically creates a document to a pre specified size (specified within the script), places a file (usually .PDF) centrally on the document page, adds crops, saves and exports.

I've got everything sorted except the place file and centre part - and to be honest after looking through the forums I'm none the wiser. Can you offer some advice please?

The file which is placed will change each time (as will its location), so I was hoping that i could use the standard place command and use the window which comes up normally...although i've horrible feeling I might have to create something - hopefully not!....I realise this is very simple for most of you, but I'm struggling!

Thanks in advance for any help!

(on a side note, would a script made from applescript enable me to select the file to be placed in InDesign, and run everything in one click, opening InDesign etc? just wondering...)

This topic has been closed for replies.

2 replies

Peter Kahrel
Community Expert
Community Expert
December 8, 2009

Use the Folder.selectDialog () function to display the OS dialog in which you pick a file. See the JavaScript Tools Guide (in ESTK's Help menu), page 57.

As to your sidenote, you can't have JavaScript start InDesign. AppleScript probably can.

Peter

Inspiring
December 9, 2009

Thanks Peter, that points me in the right direction!

Thanks very much!!

Inspiring
December 8, 2009

can anyone point me in the right direction for this please?

(I have looked at help files, downloaded some scripting guides, searched the forum but to no avail)

Thanks