Getting the page of a link

hello forum
I use applescript to automate indesign.
now I've to do a job, where I make textframes on a new layer, same size and position as image/grafic-objects on other layers.
to do this, I check the links of the document. if there are more than one page, I need the page-number/id to position my textframe.
I've tried a lot of things to find out the page of a link, but nothing is perfect.
does anybody know an absolutly sure way to get the page number of a link - for example the to get the number in the link palette of the application.
InDesign CS3 on Mac OS X 10.4.11
thank you in advance.

P.S. Once you know that the link is on a page, you can easily find the page name (aka page number). Take note that this function works for images nested in groups (no matter how deep).
#target indesign
myDoc = app.activeDocument;
myLink = myDoc.links[0];
myMessage = whereIsTheLink(myLink);
alert("My link is on " + myMessage);
function whereIsTheLink(theLink){
   while (theLink.constructor.name != 'Application') {
      if (theLink instanceof Page) {
         var myPageName = theLink.name;
   theLink = theLink.parent;
   myHierarchy += theLink.constructor.name + '|';
   if (myHierarchy.lastIndexOf('|Character|Story|Document|Application|') != -1)
      return 'inline object';
   else if (myHierarchy.lastIndexOf('|Page|MasterSpread|Document|Application|') != -1)
      return 'master page';
   else if (myHierarchy.lastIndexOf('|MasterSpread|Document|Application|') != -1)
      return 'pasteboard of master page';
   else if (myHierarchy.lastIndexOf('|Page|Spread|Document|Application|') != -1)
      return 'page ' + myPageName;
   else if (myHierarchy.lastIndexOf('|Spread|Document|Application|') != -1)
      return 'pasteboard';

Similar Messages

  • How can I get Firefox to open the page of a link I've clicked on in an email?

    Every time I click on a link, in an email (or in Facebook), unless a Firefox page is already open, I usually get my home page first. Then I have to go back to the email window to access the link again to get the page I wanted from the link. Is there a workaround?
    == This happened ==
    Every time Firefox opened
    == Not sure... maybe some months ago?

    That is this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=531552 - Firefox 3.6b opens two windows when opening external links
    please do not comment in bug reports

  • HT2534 When setting up my apple I'd I get a verification email but there does not seen to be a link to click on there is a link that says "verify now" but it's not a link the only other thing on the page is a link to apple thats starts the process all ove

    When setting up my apple I'd I get a verification email but there does not seen to be a link to click on there is a link that says "verify now" but it's not a link the only other thing on the page is a link to apple thats starts the process all over again.does anyone have a solution for this problem?

    The idea to jumpstart by change was not the smartest one, but gives you an opportunity to use that "temporary" account as permanent. You do not have a choice cause obviously despite you thinking that old account is no more -it does exist on Apple servers. And if you are unwilling to share your [email protected] with friend, just create one extra [email protected] for your friend. One suggestion - do not use gmail.

  • Since I upgraded my Firefox..whenever I click on a link i get this error message...Java Script Exc in ev handl: Error: Bad NPObject as private data! Then I have to click ok to get the page to open.

    Since I upgraded my firefox..I get this box most of the time when I click on a link to go to another page...
    Java Script
    Exc in ev handl: Error: Bad NPObject as private data! Then I have to click ok to get the page to open.

    That issue can be caused by the McAfee Site Advisor extension
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • I have aperture 3.2.4 on my laptop and have the serial number, but just bought a new MAC and I can't get the Ver 3.0 link to work. Anyone know how to move it from my laptop to our new mac?

    I have aperture 3.2.4 on my laptop and have the serial number, but just bought a new MAC and I can't get the Ver 3.0 link to work. Anyone know how to move it from my laptop to our new mac?

    I am talking about the Ver 3 download link that came with the purchase email.
    That link is no longer available. Use "Migration Assistant" to copy your Applications from your old mac to the new Mac, then immediately run software update. Aperture Version 3.2 will not run on your new mac with Mavericks, you will have to Upgrade to version 3.4.5 at least - you can download this update from the Support page: Aperture 3.4.5
    Then launch Aperture and enter your registration key and try now too update from version 3.4.5 to 3.5 from the AppStore. The AppStore will change your Aperture registration to an AppStore version, so you will able to reinstall by downloading from the AppSTore in future.
    If you want transfer only Aperture and no other applications, do it manually: You will have to copy not only the application but folders from the libraries as well:
    /Applications/Aperture.app
    /Library/Application Support/Aperture/
    ~/Library/Application Support/Aperture/
    Leonie

  • I can't get the page numbers in my table of contents to update when I update the book.

    I'm using Framemaker 11 and I have two TOCs in my book: one in English and one in French. Each TOC links to different documents in the same book. The reference page for each TOC is set and correctly displays the heading 1 and 2 I've told it to display, but the numbers do not update when the content in my document files changes to a different page. I've checked the conditional text settings in my document files; they are correct. When I update the book, I choose to update Numbering, All Cross-References, All Text Insets, OLE Links, Generate Table of Contents, Lists, and Indexes. What am I doing wrong? Thanks.

    I just tested this out and saw the same result as Rick - a book with child books ignores all generated files within the child books. This applies to adding content from them (e.g. their titles) to actually including them in the output. This applies to all versions of FM since v.9!
    However, there is a workaround for this. You need to use the hierarchical book structure in the parent book and create Folders for each book that you want to add. Then manually add the generated files (TOC, IX, List of..., etc.) and book to the respective folder. This is what it looks like for two child books in a parent book:
    Note that the child book generated files (TOC, IOR) show as just regular files at this point in the parent book. To get the page numbering to be continuous throughout the parent book, you will need to make a couple of passes. First set folder, files and books to have the Numbering continue from the previous (if you want all sequential page numbers). This will set the page numbers correctly except for what they were in the respective book TOCs. You will need to use the starting page number of the child TOC files in each folder (it shows in the Book status bar when click on the TOC file in the master/parent book).
    To set the individual book TOCs to be correct in the parent book, open the child book and set the TOC Numbering to start at the page stated in the parent book (status bar). Now update the child book to set the correct (parent book) page numbers in the child TOC. [This is a necessary manual step, as the page number assigned in the parent book is ignored when th child book is individually updated and FM uses 1 to start off the sequence in the child book.]  Repeat for each child book in the master/parent book.
    The final step is to Update the parent book and create the PDF. You should now have all of the files included in the PDF and the child TOCs should show the correct page numbers of the master book.
    This whole process of books within books seems a bit borked and one shouldn't have to be jumping through hoops to include child generated files. Please report this as a bug via: https://bugbase.adobe.com/index.cfm

  • How to get the Page Number in CS3 with VB?

    Hi, Everybody
    I use the Visual Basic to read the words and their page number where the Words are at. I want to do it according to Story. Some TextFrame of the Story waw placed in other pages: How can I get the Page number according to the Word that is selected?
    For myStoryCounter = 1 to Document.Stories.Count
    Set myStory = Document.Stories.Item(myStoryCounter)
    For myWordCounter = 1 to myStory.Words.Count
    Set myWord = myStory.Words.Item(myWordCounter)
    myWordContents = myWord.Contents
    Rem ** How to Get the Page Number according to the Word ***
    Next
    Next

    > But I don't understand why Item(1) are set.
    because Word can have more than one parent TextFrame - when split across TextFrames
    only Character have one ParentTextFrame accessed also by ParentTextFrames.Item(1)
    > why Story.TextFrames.Count alway is 0, Is it bug?
    no - it's not bug
    in older IDs - Story.TextFrames collection refer to all TextFrames as containers for Story text
    but in CS3 - collection Story.TextFrames contain all TextFrames inserted as InLine/Anchored objects - same like Story.Rectangles or Story.Ovals
    in CS3 - when you want to refer to TextFrames as containers for Story text - you need to use Story.TextContainers - because now you can link TextFrame and Text-On-Path as Story - Text-On-Path isn't TextFrame
    robin
    www.adobescripts.com

  • How to get the page layouts programmatically and create a page for that pagelayout

    how get the page layouts programmatically and create a page for that pagelayout and add webpart
    please help me with da code.Thanks
    adityadugyala

    Hi if your page layouts alreday created then create new page programaticaaly  and apply your page ayouts to that page by coding you can do something like following
    PublishingWeb publishingWeb =
    PublishingWeb.GetPublishingWeb(web);
    PageLayout[] layouts = publishingWeb.GetAvailablePageLayouts();
    PageLayout layout = layouts[0];
    string pageName =
    "MyPublishingPage5.aspx";
    PublishingPage newPage = publishingWeb.GetPublishingPages().Add(newFolder.Folder.ServerRelativeUrl +
    "/"+ pageName, layout); 
    newPageUrl = web.Url +"/" + newPage.Url;
    newPage.Description = "This my sample publishing page";
    newPage.Title = "My Publishing Page";
    newPage.Update();
    Please follow link
    http://blogs.msdn.com/b/sowmyancs/archive/2008/03/15/create-publishing-pages-in-portal-sites-programmatically.aspx
    Please mark answer , if you think answer is helpful or correct.

  • Is it possible to change the page of a linked PDF without relinking?

    Is it possible to change the page of a linked PDF without relinking and going through the import options?
    I'm trying to import seveeral pages of the same PDF. The process would be quickest if I could import it once, then duplicate the image box a number of times, then just change the page number each image box is linking to.
    At the moment I'm having to relink (or place), then go through Import Options, then choose the page - it's a long process that feels like it should be quicker.
    Any ideas?
    Thanks

    The short answer is no, that's not possible, but it IS possible to import multiple pages at one time.
    My favorite script for this is from Scott Zanelli: InDesignSecrets » Blog Archive » Zanelli Releases MultiPageImporter for Importing both PDF and INDD Files, but there's also a sample script included with ID.

  • My iPhone 5 is not catching up my website, although having a big screen... What does it need to get the pages in auto mobile queries converting?

    my iPhone 5 is not catching up my website, although having a big screen... What does it need to get the pages in auto mobile queries converting?

    You need to code your web site to recognize the mobile browser and send a page that's actually usable when it does.

  • Hi I replaced my hard drive on macbook and I want to install mac osx10.5 with the CD that came with the macbook. When I run the CD after a while I get the page showing language options for 2 second then a gray screen appears and nothing happens

    Hi I replaced my hard drive on macbook and I want to install mac osx10.5 with the CD that came with the macbook. When I run the CD after a while I get the page showing language options for 2 second then a gray screen appears and nothing happens. I partitioned my hard drive and I tried installing Microsoft windows and that worked just fine.  But I do not understand why it wont install mac os x 10.5?????  PLEASE HELP ME.  Thanks  Hamid

    Try a new post in the 10.5 Installation forum.
    DALE

  • Getting the page size in PDF file

    i want know how do get the page size in PDF file befor placing every page in document
    for example height=297 mm And width=210mm

    This script:
    http://indesignsecrets.com/zanelli-releases-multipageimporter-for-importing-both -pdf-and-indd-files.php
    answers all your questions.
    Peter

  • How to get the page number in the break section?

    Hi expert,
    The user wants the page number came right after the Break group name if the break section contains more than 1 page. E.g.
    ABC Compnay
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    BCD Company, p 1
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    BCD Company, p 2
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    CDE Company
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    How to get the page number in section break level?

    Hi Wes
    * Create a Field on the margin.
    * Set its "Source" to "Page Number"/"Physical Page Number".
    * Click "Page Numbering" button.
    * In "Reset At" list box, choose the Repeating frame that surrounds your detail group in the layout.
    This should cause Reports to increment the page number until the "Company" repeating frame resets.
    Regards
    Sripathy

  • Getting the page size and knowing how many pages they are in PDF file

    Hi There,
    when i do this script (
    var myPDFFile = File.openDialog(["Choose a PDF File"]); ) 
    with JS via Windows it is used for opening a new PDF file when i import this file i need to
    get the page size and how many pages they are in PDF file. but i dont know how to do it.
    please help me.

    Ask here: http://forums.adobe.com/community/indesign/indesign_scripting

  • Getting the page content as pdf file

    Hi All,
    I have a use case like i need to get the page content as pdf file.
    For this i found xsl file and it's config under the following locations
    /libs/cq/config/rewriter/pdf/transformer-xslt --config of source
    /libs/wcm/core/content/pdf/page2fo.xsl -- xsl file location
    For custamising this functionality i copied both confing node and xsl file under "/apps" .In the Config file i changed source to refer xsl file under /apps.But it's not taking config changes.
    I have looked into http://cqblueprints.com/xwiki/bin/view/CQ+FAQ/How+can+I+configure+the+ PDF+rewriter
    there it's saying like we need to modify the com.day.cq.rewriter.xml.XSLTTransformer class. i am not getting how to modify it.
    I need this urgently
    Thanks,
    Chinna Yadlapalli.

    This script:
    http://indesignsecrets.com/zanelli-releases-multipageimporter-for-importing-both -pdf-and-indd-files.php
    answers all your questions.
    Peter

Maybe you are looking for

  • How to turn off "screen resolution" warning in iPhoto?

    I am running OS X Yosemite 10.10.1 on a Mac mini (Late 2012), 2.3 GHz, 4 GB memory, iPhoto version 9.5.1 (902.17). I get the "screen resolution not optimal for iPhoto" warning repetitively about once every 15 minutes as long as iPhoto is running. I h

  • Home Sharing - how to get music files to transfer from one computer to another...

    I have two computers in my home authorised for Home Sharing - I have no problems locating the other library on either of my computers. However, when I am on iTunes in Computer A and I click onto Computer B's music library (so that I can transfer musi

  • Half of the bookmarks in my bookmarks toolbar have disappeared.

    I think this happened after a recent update. I still have the first half of my bookmarks in the bookmarks toolbar but the second half have disappeared. I still have all my other bookmarks but my history has also disappeared along with the most freque

  • Problem in message sending of nokia 6080

    my sim card is unable to allow message sending from most of the nokia 6080 mobile phones.but,my sim can send messages from all other mobile phones in the usual manner.i have sent my cell to one of the nokia care centres(job sheet number:319434038/070

  • Apple care protection

    hello. i'm going to buy apple care protection for macbook pro online but im a bit confused about these 2 products. what is the difference between applecare protection plan for macbook pro http://store.apple.com/my-k12/product/MD013FE/A/applecare-prot