How can a script access all link properties?

I'm really glad to find this pool of expertise out in the cloud. TIA for all replies.
I'm looking for proper syntax to access the more detailed properties of graphic file links, such as the page# on which they appear and effective PPI. These are visible in the link window, but I cannot find them in the ESTK for CS4 Object Model Viewer. There is are name, filePath, and linkType, which are all very useful and also visible in the link window. But as for the other info I see only a suggestive attribute called "properties" which is itself an object, and I cannot seem to query its contents.
As I'm very, very new to scripting the cause could be little more than my own ignorance.
Is there a way to convert and object to strings so I can see how it is built?
In case anyone is interested, I'm trying to amplify a very helpful little script written three years ago by Steve Wareham:
// ====== ListLinks ====== \\
/* This is a JavaScript for InDesign. It will create a new text box on the first page of your document, and list all the links used in your document.
A dialog box provides options to list the links names, files paths, and file types. Created by Steve Wareham 5/08/2007
attempts to amplify with addition of Page and Effective PPP by Marc Shargel May 2010 */
// ----- Dialog Box ------\\
var myDialog = app.dialogs.add({name:"Link Lister", canCancel:true});
with(myDialog){
with(dialogColumns.add()){
with(borderPanels.add()){
with(borderPanels.add()){
staticTexts.add({staticLabel:"What link information do you want? "});
with(dialogColumns.add()){
with(borderPanels.add()){
var my1RadioButton = checkboxControls.add({staticLabel:"Names", checkedState:true});
var my2RadioButton = checkboxControls.add({staticLabel:"Paths"});
var my3RadioButton = checkboxControls.add({staticLabel:"File type"});
var my4RadioButton = checkboxControls.add({staticLabel:"Page"});
var my5RadioButton = checkboxControls.add({staticLabel:"Effective PPI"});
// extending the dialogue box was easy...
// ----- End of Dialog Box ----- \\
//----- Begin ----- \\
if(myDialog.show() == true){
var myDocument = app.activeDocument;
var totalLinks = myDocument.links.length;
var myNewTextFrame = myDocument.textFrames.add() // Add a text frame to display the list of links
myNewTextFrame.geometricBounds = [ "0p0", "0p0", "50p5", "50p5"];
for ( i = 0;  i < totalLinks;  i++ )
if (my1RadioButton.checkedState == true) {
myNewTextFrame.contents = ( myNewTextFrame.contents + "File: " + myDocument.links.item(i).name );
if (my1RadioButton.checkedState == true) {
myNewTextFrame.contents = ( myNewTextFrame.contents + " Path: " + myDocument.links.item(i).filePath );
if (my3RadioButton.checkedState == true) {
myNewTextFrame.contents = ( myNewTextFrame.contents + " Type: " + myDocument.links.item(i).linkType );
//... but the following lines do not work. I can refer to "myDocument.links.item(i).properties" but it is reported as an object.
//if (my4RadioButton.checkedState == true) {
//myNewTextFrame.contents = ( myNewTextFrame.contents + " Page#: " + myDocument.links.item(i).page );
//if (my5RadioButton.checkedState == true) {
// myNewTextFrame.contents = ( myNewTextFrame.contents + " PPI: " + myDocument.links.item(i).effectivePPI );
myNewTextFrame.contents = ( myNewTextFrame.contents + '\r' );
myDialog.destroy();

Is there a way to convert and object to strings so I can see how it is built?
Whoops, I'd meant to answer this. Sure, you can just loop over the object. For instance, since you were curious about the "properties" member, suppose we wanted to look at the individual members of the properties object of a link.
Just type in the JavaScript console:
{ var p = app.activeDocument.links[0].properties; for (var i in p) $.writeln(i + "\t"+p[i]); }
which produces:
versionState     1986221653
editingState     1986217301
linkXmp     [object LinkMetadata]
index     0
parent     [object Image]
assetURL    
assetEtag    
assetID    
edited     false
name     yeti.png
needed     true
status     1852797549
linkType     Portable Network Graphics (PNG)
date     Mon May 24 2010 15:36:52 GMT-0400
size     113083
filePath     Hermann Zapf:Users:writer:Desktop:yeti.png
id     209
label
You'll note that these are all the same members that the links[0] object itself has. Again, "properties" is just a convenience for setting more than one at once. So compare the output to:
{ var p =  app.activeDocument.links[0]; for (var i in p) $.writeln(i +  "\t"+p[i]); }
How does that work? Well, the syntax "for (i in p)" calls the for loop once for every member of the Object p, and then we print out the name of each member along with its value.
(I guess the good JavaScript programmers would encourage you to put {}'s around the $.writeln, and the really anal people would remind you that JavaScript does not have block scope* and therefore you should wrap the whole thing in:
"function(){ ... }()".
(*:reference is to Javascript: The Good Parts; Awful Parts, a book (well, chapter thereof) well worth reading.))

Similar Messages

  • How can my wife access all of our itunes music if she signs up for iTunes match, but her apple id is different than mine?

    How can my wife access all of our iTunes music, even if she subscribes to iTunes Match, if her Apple ID is different than mine?

    I do subscribe to iTunes Match.....and the music i am referring to is all of our downloaded albums and songs that are currently in iTunes and in the "cloud" on my iPhone and my iPad.
    So if she uses my Apple ID for her iPhone, she can sign up for iTunes Match on my account?  Will any of my apps then transfer to her phone?  Or just the iTunes "data"?

  • How can I script a Flash .exe file to always stay on top of all other windows?

    Hi All,
    I'm new to action script, and I just need this one script
    > How can I script a Flash .exe file to always stay on top of
    all other windows?
    Basically what i want to do is have a flash-created
    step-by-step instructional movie, but for the movie to remain on
    top of all windows so the instructee is able to follow the
    instructions on-screen...
    It would be preferable to not have to buy another product
    just to do this... as I said, this is the only scripting I need.
    Thanks in advance
    Cheers
    Rick

    if you create your exe with mProjector you can use one of its
    new AS
    commands to do this.
    setZOrder
    http://www.screentime.com/software/mprojector/docs/mWin_setZOrder.htm
    all APIS
    http://www.screentime.com/software/mprojector/docs/index.html
    Demo
    http://www.screentime.com/software/mprojector/demo.html
    mProjector installs new classes and help into Flash, to
    enable them you
    must build your app with mProjector (its input is your swf)
    John Pattenden
    Screentime Media - Flash Tools since 1997
    http://www.screentime.com

  • Hi my name Abukar I had an old apple ID and I had problem with signing it so I decided to make a new apple ID with a new email address, so how can I link with two apple IDs and how can I get back all my previous apps that I purchased before, I cloud stuff

    Hi my name Abukar I had an old apple ID and I had problem with signing it so I decided to make a new apple ID with a new email address, so how can I link with two apple IDs and how can I get back all my previous apps that I purchased before, I cloud stuff

    It is not possible to do that.
    Allan

  • How can we provide access/provide permissions to a user/group for group of folders at single step??

    Hi Nico, Thaks you so much for your reply,, Can you please advice or give me some steps to write script pelase? Regards,Kareem

    Hi All, How can we provide access/provide permissions to a user/group for group of folders  at single step?? I can able to provide access for a single folder at a time. I want provide access to a list of  folders( more than 30 ..) at single step?? Regards,Kareem

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • After downloading iOS 7 on my 4S I show 8,976 on my email icon.  How can I eliminate them all without going one at a time?

    After downloading iOS 7 on my 4S it shows 8,976 on the email icon.  How can I move them all to trash without doing it one at a time?

    Apple's official advice is here... HT2905 - How to find and remove duplicate items in your iTunes library. It is a manual process and the article fails to explain some of the potential pitfalls.
    Use Shift > View > Show Exact Duplicate Items to display duplicates as this is normally a more useful selection. You need to manually select all but one of each group to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks, however this works best when performed immediately after the dupes have been created.  If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin.
    Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See this thread for background and please take note of the warning to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    tt2

  • How can I restrict access to add. internal hard drive by account?

    Hello! Okay, so I am my computer's administrator, and I have a secondary 'guest' account that anyone else can use. So, I know that all my data on my main, OS hard drive is secure from the guest account accessing it, but what about the additional hard drive that I have installed?
    I have a good deal of sensitive data and files stored (and aliased) on my second internal drive that I do not care for 'guest' users to stumble upon. How can I restrict access to the secondary storage hard drive from my Guest login account, and/or just plain hide it from it? Surely, there is a need for this that has brought about a solution. Any tips/advice/solutions?
    Thanks!!!
    =)

    Click here and follow the instructions followed by placing the folders and files on the image; if the password is in the keychain, it will be supplied whenever you're logged in.
    (41018)

  • How can I change an embedded link to a website in a pdf

    How can I change an embedded link to a website in a pdf in Pro XI for Mac?

    You can use the Select Object tool to select the link object and then right-click it and edit it via Properties.

  • How can I get my century link email on my iPhone under mail?

    How can I get my century link email ([email protected]) to come on my iphone in Mail and not accessing it through safari?

    Contact your mail provider for the correct settings to use, and go to Settings>Mail, Contacts, Calendars and add the account.

  • Script out all linked servers. Is it possible?

    Hi All,
    Is there any query available for scripting out all linked servers which can be used while migrating from one sql instance to another sql instance? We have like 40 odd linked servers which has to be scripted out and moved to new server.
    We are doing migration from sql server 2008 r2 to sql 2014.
    Thanks in Advance.

    Hello,
    Try the following resource.
    http://www.sqlservercentral.com/scripts/Miscellaneous/30620/ 
    http://sev17.com/2010/07/06/scripting-linked-servers/
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • How can i use session to save properties?

    How can i use session to save properties?

    Hi,
    Session Tracking is one of the most powerful features of Servlets and JSP. Basically, the servlet engine takes care of using Cookies in the right way to preserve state across successive requests by the same user. Your servlet just needs to call a single method (getSession) and it has access to a persistent hashtable of data that's unique to the current user.
    Otherwise Visit Servlet Essentials tutorial
    http://www.novocode.com/doc/servlet-essentials/

  • How can I get access back to sounds and lessons I have not downloaded before updating?

    When I purchased my Mac about two months ago, I had access to all of the lessons and sounds, I just had to download them.  I recently downloaded and installed the update and in doing so I lost access to sounds and lessons I had not downloaded.  It tells me that I need to purchase the sounds and lessons package.  How can I get access back since I have already purchased it?

    Apple does not support downgrading the iOS.
    Yes, iOS 7 looks quite different. But there are many new and valuable features. As time goes on you will not remember how it used to look.

  • How can get emails on all devices?

    How can get emails on all devices? When I read an email on my mac, my iphone doesn't download it. How can I change that setting?? I need to have all emails and all my devices!

    It sounds like your using a POP3 email account versus IMAP. With a POP3 account if you do not have the settings configured to leave email on the server the problem you describe will occur. With Outlook 2010 (on a PC for example) you can go into the account settings and configure to leave email on the server. That way both devices will see the email. Check help for your Mac email program for instructions...
    http://www.serverintellect.com/support/email/outlook-leave-on-server/
    A better solution is if your email provider uses IMAP. IMAP sync email folders between multiple devices. Meaning any device will receive the email, all sent email can be seen on the devices. If you delete email from one device the email is deleted from all the other devices. Check with your email provider to see if they offer IMAP services.
    If they do not your choices are to 1) configure email on the Mac as illustrated in the link above or 2) change email providers to something like Gmail or Outlook.com (as examples).
    Also see this for the iPad...
    Using a POP account with more than one device - Apple Support
    FWIW I use Cox IMAP email and fully sync email between a Win 8.1 Update 1 laptop, a Win 7 desktop, an iPad 4, an iPhone 4 and an iPhone 5S.

  • How can't I move all my contacted and photos from my old iCloud account to my new account

    How can't I move all my contacted and my photos from my old iCloud account to my new iCloud account . And how do I know I got photos saved on my iCloud account

    If you sign into your old account using your iPhone and turn on contacts (Settings > iCloud) then once all of your contacts are on your iPhone turn contacts back off and select keep on my iPhone.  Then delete account on the old account and sign in with your new iCloud account and turn on contacts and select merge.  That will get your contacts over.
    If you have photos stored in iCloud it will be in My Photo Stream.  This section only keeps the last 30 days of auto uploads from any of your devices or computers that are using this feature.  You can access these photos by signing into the old iCloud account in Settings > iCloud and enable Photos > My Photo Stream.  If you have any photos in there, they will load into your Photos App.  In the Photos App, tap Albums in the bottom right, then tap My Photo Stream.  There is no way to upload them to your new iCloud account once you sign into it short of creating a Shared Photo Stream and inviting yourself to it.
    In the end you should really try to keep one Apple ID for everything when possible as there is no way to merge Apple IDs and you can end up in a tangled mess.
    How to export iCloud contacts as vCards: http://support.apple.com/kb/PH3606
    My Photo Stream FAQs: http://support.apple.com/kb/ht4486
    Shared Photo Stream FAQs: http://support.apple.com/kb/HT5903

Maybe you are looking for

  • HT4910 how do I import a calendar from Outlook?

    I would like to import an outlook.com calendar into the iCloud calendar.  Can you help me? Thank you! Cheryl

  • Business object for PO and SWOTICE entries

    Hi all, We've copied the standard business object for a PO - BUS2012 to a Z object to be used in a workflow. In one of the methods for this Z object, we've used BAPI_PO_CHANGE to block an item of the PO. As soon as the program was generated, under th

  • Proxy mime types problem (HELP!)

    I have an application which I have running ow two machines. On one machine, WebLogic is running on port 80. On the other machine I am using iPlanet Web Server with the NSAPI plugin pointing back to a WebLogic server running the same application. It a

  • BBM Group Notification Icon

    Hi, I'm using BBM 5.0.1.38 on my 9700. Since then, my BB Group notification icon for every group always display the same icon instead of specific icon that I set it to each of group. Is there a workaround to fix this? Cheers and thanks.

  • Do I wait for my iPhone 5 to be shipped to me or is it the other way around and I need to ship it to them?

    I put my iPhone threw the replacement option today and I'm just so confused because I'm not sure if the new iPhone will be shipped to me first and I'll ship my cracked and non-replaceable iPhone back to them or if it is the other way around, I do not