-
Notifications
You must be signed in to change notification settings - Fork 1
/
SelectNextUnconvertedInlines.jsx
32 lines (32 loc) · 1.07 KB
/
SelectNextUnconvertedInlines.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//PasteIntoHack.jsx
/*
@@@BUILDINFO@@@ "DeleteAllInstancesOfLink.jsx" 1.0.0 21 October 2013
*/
// Select an image, then this will delete all other links of same image
//
main();
function main() {
stories = app.selection;
app.activeDocument.select(NothingEnum.NOTHING);
if( stories.length < 1 ) {
stories = app.activeWindow.activeSpread.pageItems.everyItem().getElements();
}
for( i = 0; i < stories.length; i ++ ) {
if( stories[i] instanceof TextFrame ) {
graphs = stories[i].parentStory.allPageItems;
while( t = graphs.pop() ) {
if( t instanceof Group ) {
if(
t.isValid &&
t.hasOwnProperty('anchoredObjectSettings') &&
(t.parent instanceof Character) &&
t.anchoredObjectSettings.anchoredPosition == AnchorPosition.INLINE_POSITION
) {
t.select();
return;
}
}
}
}
}
}