Can someone help me to change the script function?

I have a script for indesign:
var link, image, frame, 
doc = app.activeDocument, 
links = doc.links, 
counter = 0; 
for (var i = links.length-1; i >= 0; i--) { 
    if (links[i].status == LinkStatus.LINK_MISSING) { 
        try { 
            link = links[i]; 
            image = link.parent; 
            frame = image.parent; 
            frame.remove(); 
            counter++; 
        catch (err) { 
            $.writeln(i + " - " + err); 
which is made by Kasyan Servetsky, function: remove all missing link objects, it runs very well, But only work on single file,
now I want change the function aim to let it work on all the open file,
for example I opened over ten files, all the file have missing like objects, I want to remove all the missing link objects in all the file by just one click the script,
is that possible?

@HarveyLiu – so to make it absolutely clear:
This one is a short form for using the var statement for every variable used:
var link, image, frame,
doc = app.activeDocument,
links = doc.links,
counter = 0;
You could write it like that:
var link;
var image;
var frame;
var doc = app.activeDocument;
var links = doc.links;
var counter = 0;
And then change the var links statement:
The variable doc is not needed anymore. You can remove that line. Or leave it in, if you want to do something to the active document.
var link;
var image;
var frame;
var doc = app.activeDocument;
var links = app.documents.everyItem().links.everyItem().getElements();
var counter = 0;
Or you could change the original code like that:
var link, image, frame,
doc = app.activeDocument,
links = app.documents.everyItem().links.everyItem().getElements(),
counter = 0;
The variable links now holds all the [ object Link ] objects in every document stored in an array made by getElements()
The for loops accesses this array called by its variable name links now. Do not confuse this name or the array represented by the variable called links with the "links" part of the code in doc.links or in links.everyItem() .
doc.links is addressing a collection. The collection of every [ object Link ] .
Uwe

Similar Messages

  • Error message while burning DVD with Premiere Elements 13 with Mac Book Pro i7/7200t/mn with 60GO free space available on gard drive. message: "erreur logicielle interne: DVA/premiere/elements/pre12/pre-mediacoreCS7". can someone help burn my DVD (the fil

    Error message while burning DVD with Premiere Elements 13 with Mac Book Pro i7/7200t/mn with 60GO free space available on gard drive. message: "erreur logicielle interne: DVA/premiere/elements/pre12/pre-mediacoreCS7". can someone help burn my DVD (the file goes very well with chapters and scenes before burning). thanks very much, response appreciated, Alain

  • HT1926 Trying to re-install iTunes and the message "Apple mobile device failed to start. Verify that you have sufficient privileges to start system services." But I don't know what to do? Please can someone help, I'm not the most technologically advanced

    Trying to re-install iTunes and the message "Apple mobile device failed to start. Verify that you have sufficient privileges to start system services." But I don't know what to do? Please can someone help, I'm not the most technologically advanced person.

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (if this won't uninstall move on to the next item)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
    Please note:
    Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    tt2

  • HT5622 I want to change my security information so I went to "Manage your Apple ID" but I could not find "Reset your security information" can someone help me to change my security answers. Thanks in advance

    Hello Everyone,
    I want to change my security information so I went to "Manage your Apple ID" but I could not find "Reset your security information" can someone help me to change my security answers.
    Thanks in advance

    call 1-800-275-2273 (1-800-MY-APPLE)

  • I bought the APP Sasol Birds. 146MB of the 147,5MB downloaded without any problem. The download stopped and first the error code 3259 and later the error code 8012 appeared. Can someone help? I want the download to be completed. Thank you. Pieter Strobos

    I bought the APP Sasol Birds. 146MB of the 147,5MB downloaded without any problem. The download stopped and first the error code 3259 and later the error code 8012 appeared. Can someone help? I want the download to be completed. Thank you. Pieter Strobos

    Maybe your firewall or security software are preventing the download from finishing. You could try disabling them until you finish the download

  • Can someone help me to get the link where to download adobe acrobat pro XI english/arabic version?

    can someone help me to get the link where to download adobe acrobat pro XI english/arabic version?

    for english:
    if you follow all 7 steps you can dl a trial here: http://prodesigntools.com/adobe-acrobat-xi-pro-standard-reader-direct-download-links.html
    and activate with your serial.
    if you have a problem dl'g, you didn't follow all 7 steps.  the most common error involves failing to meticulously follow steps 1,2 and/or 3 (which adds a cookie to your system enabling you to download the correct version from adobe.com).

  • Can anyone help me to change the file to version 8.6 ??

    can anyone help me to change the file to version 8.6 ??
    Attachments:
    Hydrostatic_Test.vi ‏2362 KB

    Duplicate Post.
    http://forums.ni.com/ni/board/message?board.id=170&thread.id=465548
    Tim
    Johnson Controls
    Holland Michigan

  • HT5787 can you help me with change the security question

    can you help me with change the security question

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then the steps half-way down this page give you a reset link on your account : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address (you won't be able to add one until you can answer your questions) then you will need to contact iTunes Support / Apple in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 link above to add a rescue email address for potential future use

  • I am using Iphone 3 GS since last 4 months. I have note registered it under Icloud and unfortunately i have lost my cel 2 days before. Can someone help me / tell me the ways that i can get my cel back or trace it..?

    I am using Iphone 3 GS since last 4 months. I have note registered it under Icloud and unfortunately i have lost my cel 2 days before. Can someone help me / tell me the ways that i can get my cel back or trace it..?

    No way to trace it if you didn't active Find my Phone on your iPhone before you lost it.
    Notify your carrier and your police of the loss.  Chances are you will never get your phone back.

  • HT201407 I have problem with My IPhone after updating I was asked to enter password etc then asked to agree the terms and conditions which I did but nothing happens it stays on this page can someone help how to complete the last stage of updating?

    I updated my I Phone4 with the latest version iOS7 after updating I was asked to enter I tune password etc and then was asked to accept the terms and conditions which I did......but nothing happens it stays on the same unable to complete the final stage.....my phone does not work I am stuffed can someone help.....cannot get thru to Apple I tried contacting them

    Hi Rajvidya Das,
    Do the following, then try again:
    1.     Close all open apps: Double click on the Home key and then swipe up on each of the thumbnails that appear above the open app icons
    2.     Sign out of the iTunes store: Settings>iTunes & App Store, click on your Apple/iTunes ID, then sign out
    3.     Check Settings>Safari, and make sure that "Block Cookies" is not set to "Always". If it is, change it to either of the other two options
    4.     Make sure you do not have Restrictions turned on. If they are turned on, make sure that access is allowed for Safari, iTunes Store, Installing Apps, and Deleting Apps
    5.     Reset your device (nothing will be lost): Hold down the Home and Power buttons at the same time and continue to hold them down until the Silver Apple appears (up to 30 seconds). Once the Home screen redisplays sign back into iTunes and try again
    Cheers,
    GB

  • My ipod classic is not showing in devices anymore. Can someone help me determine what the issue might be?

    My ipod classic 30gb is not showing as a recognized device in iTunes anymore. When I plug the device in, it shows a black backgroud with the apple logo and nothing happens. Can someone help me as to what the problem might be?
    Thanks,
    "keep calm and chive on"

    Some phones can only send and recieve SMS messages. If the recipients phone doesn't support MMS they won't be able to recieve a text with a photo.
    To get your photos in Photo Stream, you'll need to setup iCloud. Check out this Apple article for more info -> iCloud: Photo Stream FAQ

  • Can someone help me to find the game center i used for my clash of clans village

    i play clash fo clans on ym ipod but i just got the pc version and its android. i know how to link them both so you can get the account onto my pc but when i press i want to link to another device it says "the current village is attached to a different game centre account than the one your logged into. but the problem is i dont know what game centre i logged into when i first got clash of clash. can someone plz help me.

    Hello DvLNeonZz
    On your iOS device you can go to Settings > Game Center to see what you ID is to get it linked up for the game.
    Using Game Center
    http://support.apple.com/kb/ht4314
    Regards,
    -Norm G.

  • Can someone help me understand what the measurement em stands for?

    I have been running into the measurement em (or is it en) and I cannot find an explanation as to what it means. Can someone explain it to me with an example or two?
    Thank you
    Allen Macfalda

    Murray *ACP* wrote:
    It's a relative font metric.  1em means use the browser's default size, while .5em means use half the browser's default size.  The default size is usually 16px, unless changed by some other CSS on the site.
    Hi
    To add to whar Murray has written, the relative font metric actually comes from the size of the letter 'm'. This means that if you have a width of 20em it will be 20 times the width of the letter 'm' in your chosen font not the browsers default font, (thats the theory). Some older browsers may use the browsers default font, (NN4, I did say old!) or even a few current mobile browsers.
    It is also possible, (in a few modern browsers) to use en or ex for the mesurement, and these are based on the letter 'n' and 'x' respectively.
    PZ

  • Can anyone help me to change the page size to 4"' by 6" in Output designer 5.6

    I want to change the page size of my output designer to 4" height and 6" width. Can anyone guide me with the steps. Also my test presentment is a HP Laser Jet printer

    maybe that application add in disable after office upgrade
    try to manage add in related to that banking software
    https://support.office.com/en-US/Article/Enable-or-disable-addins-in-Office-programs-3e533d0f-a6cf-44b7-b6b4-3d9185b5e025
    https://support.office.com/en-us/article/View-manage-and-install-add-ins-in-Office-programs-16278816-1948-4028-91e5-76dca5380f8d
    I suggest you also contact Misys support for more troubleshoot option
    share with us the update

  • Can anyone help me trouble shoot the "search" function in Outlook?

    After rebuilding my Outlook identity, the search function is no longer working. I have rebuilt again, restarted computer, etc. Are there other tips?

    Well lets see if I can help.
    Connect like this:
    Red---->Aud_fpout_L
    Jump with Red---->Aud_ret_L
    White---->Aud_fpout_R
    Jump with white---->Aud_ret_R
    I think is... Spiral---->Aud_gnd this you have to share with the mic that is also Spiral
    As for the mic .... MIC power---->Aud_mic_bias
    MIC-IN---->AUD_mic
    And I think that's it....
    Be well....

Maybe you are looking for