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

Move Object Location Script

Community Beginner ,
Apr 20, 2017 Apr 20, 2017

Hi all -

I'm not really familiar with the scripting process, but I am trying to learn! I did a search for this answer but haven't come up with much.

Was wondering if someone could explain how to create a simple script to place a selected object in a specific location. I'd be using this to move a certain object to the top left or right spread in our publication (X: -.25, Y:-.25).

Thanks again!

TOPICS
Scripting
5.6K
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
Community Expert ,
Apr 20, 2017 Apr 20, 2017

Post in the InDesign Scripting forum here:

InDesign Scripting

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
Community Expert ,
Apr 20, 2017 Apr 20, 2017

I assume you are learning JavaScript?

This would move a selected object. The X,Y has to be enclosed in brackets as the move function's parameter. You also have to consider the document's units setting (is it really inches?) and the page's zero point (is it really (0,0)?)

var s=app.activeDocument.selection[0]; 

s.move([-.25,-.25])

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
Community Expert ,
Apr 20, 2017 Apr 20, 2017

Moving to InDesign Scripting forum. The regular forum is busy enough already.

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
Community Beginner ,
Apr 20, 2017 Apr 20, 2017
LATEST

Thanks too all, Rob this works perfectly. I appreciate it!

And sorry for the wrong forum location, I'll be sure to post there in the future.

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
Guide ,
Apr 20, 2017 Apr 20, 2017

Hi joep,

In case you just need a tool without entering the maze of InDesign coordinate spaces, the free version of Equalizer can do the job. Just set the X- and Y- locations once and you're done:

Indiscripts :: Equalizer

@+,

Marc

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