Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Update Links

$
0
0

This could be easily done with idle task.

 

Turn auto update on:

#targetengine tomaxxiTEST 
main (); 
function main () {    var        uTask = app.idleTasks.add ( { name: "tomaxxiAUTOupdate", sleep: 1000 } ),        uEvent = uTask.addEventListener ( IdleEvent.ON_IDLE, uUpdate, false );        alert ( "Auto update modified links is ACTIVATED!" );} 
function uUpdate ( e ) {    if ( app.activeDocument.links.everyItem ().status.toString ().indexOf ( "LINK_OUT_OF_DATE" ) != -1 )        app.menuActions.itemByID ( 132633 ).invoke ();}

 

Turn auto update off:

#targetengine tomaxxiTEST 
main (); 
function main () {    if ( app.idleTasks.itemByName ( "tomaxxiAUTOupdate" ).isValid ) {        app.idleTasks.itemByName ( "tomaxxiAUTOupdate" ).removeEventListener( IdleEvent.ON_IDLE, uUpdate, false );        app.idleTasks.itemByName ( "tomaxxiAUTOupdate" ).remove ();        alert ( "Auto update modified links is DEACTIVATED!" );    }else{        alert ( "Auto update modified links is NOT ACTIVE!" );    }}

 

This is just basic example. It could be extended way more.

 

Be aware that this will update ALL links in active document.

If you switch to another document, it will update all modified links as well.

 

Hope this will help you.

 

(How to Install a Script in InDesign That You Found in a Forum or Blog Post)

 

--

Marijan (tomaxxi)

http://tomaxxi.com


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>