Skip to main content
hamdifem
Inspiring
November 20, 2014
Answered

How break with script to anchored object release

  • November 20, 2014
  • 1 reply
  • 2247 views

There are many linked objects within a text frame

I am selecting the text frame. I want to release the linked objects

This topic has been closed for replies.
Correct answer Sajeev Sridharan
Marc Autret Method:

var a = app.selection[0].allPageItems, t; 

 

while( t = a.pop() ) 

    { 

    t.isValid && 

    t.hasOwnProperty('anchoredObjectSettings') && 

    (t.parent instanceof Character) && 

    (t=t.anchoredObjectSettings).isValid && 

    t.releaseAnchoredObject(); 

    } 

Jongware Method:


n = app.selection[0].textFrames.length; 

while (n >= 0) 

     try { 

          app.selection[0].textFrames.anchoredObjectSettings.releaseAnchoredObject(); 

     } catch(_) {} 

     n--; 

}

Vandy

1 reply

Sajeev SridharanCorrect answer
Legend
November 20, 2014
Marc Autret Method:

var a = app.selection[0].allPageItems, t; 

 

while( t = a.pop() ) 

    { 

    t.isValid && 

    t.hasOwnProperty('anchoredObjectSettings') && 

    (t.parent instanceof Character) && 

    (t=t.anchoredObjectSettings).isValid && 

    t.releaseAnchoredObject(); 

    } 

Jongware Method:


n = app.selection[0].textFrames.length; 

while (n >= 0) 

     try { 

          app.selection[0].textFrames.anchoredObjectSettings.releaseAnchoredObject(); 

     } catch(_) {} 

     n--; 

}

Vandy

hamdifem
hamdifemAuthor
Inspiring
November 20, 2014

both command don't try

Legend
November 20, 2014

i can't understand, could you explain clearly