Skip to main content
dublove
Legend
July 23, 2025
Answered

How to determine if the currently selected object is outside the page (outside the bleed)?

  • July 23, 2025
  • 2 replies
  • 673 views

Use script,

How to determine if the currently selected object is outside the page (outside the bleed)?

Or, if the object is outside the bleeding area, move it into the layout area. Should it be divided into left and right?

Like this:

Is it called Editing?
Or meOffset = measurementEditboxes?

 

Correct answer rob day

An object on the pasteboard as no parentPage—this will return Null:

 

var sel = app.activeDocument.selection[0].parentPage;
alert(sel)

2 replies

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
July 25, 2025

An object on the pasteboard as no parentPage—this will return Null:

 

var sel = app.activeDocument.selection[0].parentPage;
alert(sel)
dublove
dubloveAuthor
Legend
July 25, 2025

How do I move it into the layout, for example, horizontally in the first column?

Like this?

 
var cp = app.activeDocument.selection[0].parentPage.marginPreferences.columnsPositions;
 cb = s.images[0].geometricBounds;
s.move([cb[0],cp[1])
 
rob day
Community Expert
Community Expert
July 25, 2025

Check if the parent page is null, if it is move on to the page

 

var sel = app.activeDocument.selection[0];
if (sel.parentPage == null) {
	sel.move([0,0])
} 
dublove
dubloveAuthor
Legend
July 25, 2025

I seem to have 10,000 questions.
100 have been resolved.