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

Move Object Location Script

Community Beginner ,
Apr 20, 2017 Apr 20, 2017

Copy link to clipboard

Copied

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

Views

4.9K

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

Copy link to clipboard

Copied

Post in the InDesign Scripting forum here:

InDesign Scripting

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

Copy link to clipboard

Copied

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])

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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.

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

Copy link to clipboard

Copied

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

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