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

Align Script

New Here ,
Nov 13, 2024 Nov 13, 2024

Copy link to clipboard

Copied

Trying to develop a script that will align an object horizontally center and vertically to bottom.

This is what I have but can't get it to align to the bottom

 

tell application "Adobe InDesign 2025"

                set selList to selection --assumes more than one item selected

                tell document 1

                                align align distribute items selList align option horizontal centers

                                align align distribute items selList align option vertical centers

                end tell

end tell

TOPICS
Scripting

Views

154

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 ,
Nov 13, 2024 Nov 13, 2024

Copy link to clipboard

Copied

in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.



<"moved from using the community">

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 ,
Nov 15, 2024 Nov 15, 2024

Copy link to clipboard

Copied

have you tried bottom edges?

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 ,
Nov 16, 2024 Nov 16, 2024

Copy link to clipboard

Copied

tell application "Adobe InDesign 2025"
    set selList to selection -- assumes items are selected
    tell document 1
        -- Align horizontally to center
        align align distribute items selList align option horizontal centers

        -- Align vertically to bottom
        align align distribute items selList align option bottom edges
    end tell
end tell

 

as per @leo.r 

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
New Here ,
Nov 18, 2024 Nov 18, 2024

Copy link to clipboard

Copied

LATEST

Thank you. I got this from someone. it aligns the image to the page centered horizontally and vertically .1875" from the bottom of the page.

 
// Align a page item relative to the page
 
(function () {
 
var frame = app.selection[0];
 
var pb = frame.parentPage.bounds;
var pageVCentre = pb[2]/2;
var pageHCentre = pb[3]/2;
 
var gb = frame.geometricBounds;
var frameVCentre = gb[0] + ((gb[2]-gb[0])/2);
var frameHCentre = gb[1] + ((gb[3]-gb[1])/2);
var frameBottom = gb[2];
 
frame.move (undefined, [
pageHCentre - frameHCentre, // x-move
//pageVCentre - frameVCentre  // y-move, frame bottom to page centre
//pageVCentre - frameBottom   // y-move, frame bottom to page centre
pb[2] - frameBottom - 0.1875   // y-move, frame bottom to page bottom
]);
 
}());

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