Skip to main content
dublove
Legend
Jul 23, 2025 1:12 PM UTC
Answered

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

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?

 

rob day
rob dayCorrect answer
Community Expert
Jul 25, 2025 11:40 AM UTC

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

 

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

23 replies

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
Jul 25, 2025 11:40 AM UTC

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

 

var sel = app.activeDocument.selection[0].parentPage;
alert(sel)
Translate
dublove
dubloveAuthor
Legend
Jul 25, 2025 11:59 AM UTC

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])
 
Translate
rob day
Community Expert
Community Expert
Jul 25, 2025 12:42 PM UTC

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])
} 
Translate
dublove
dubloveAuthor
Legend
Jul 25, 2025 10:42 AM UTC

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

Translate