[CS4] "Progress bar" relative to the actual page number

Hi!
First of all thanks to the community. It's being really helpful with my start on inDesign scripting! 
I'm trying to insert a kind of progress bar on each page showing the percentage of the pages you have already read. Something like this sketch:
I think I can start with this script (by [Jongware]-GfBROo) that will set the size of the dark shape, but I don't know how to do it relative to the current page number... Any tip or link to some post I can adapt?
//DESCRIPTION:Change all Swatch Objects size to a predefined value
change_width = 10;
change_height = 20;
for (a=0; a<app.activeDocument.allPageItems.length; a++)
if (app.activeDocument.allPageItems[a].appliedObjectStyle.name == "swatch")
  gb = app.activeDocument.allPageItems[a].geometricBounds;
  app.activeDocument.allPageItems[a].geometricBounds = [gb[0], gb[1], gb[0]+change_height, gb[1]+change_width];
Thank you so much!

Problem solved!
(thanks to andrewman from Domestika forums)
Here is the script for my specifc requirements:
* Progress bar
* javascript (.jsx)
// Change according to the document
width_bar = 20;
style_name = "current_progress";
num_pags = app.activeDocument.pages.length;
increase = width_bar/num_pags;
for( i=0; i < num_pags; i++ ) {
pg = app.activeDocument.pages.item(i);
for( j=0; j < pg.allPageItems.length; j++ ) {
pgi = pg.allPageItems[j];
if( pgi.appliedObjectStyle.name == style_name ) {
dim = pgi.geometricBounds;
progress = Math.round( (( dim[1] + increase ) + ( i * increase )) * 100 ) / 100;
pgi.geometricBounds = [ dim[0], dim[1], dim[2], progress ];
alert('Done!');
THINGS TO CHANGE: width of the bar (will be the length in the last page) and the style name you are going to use.
Just need to create the bar on the master page, give it the style,  select all the pages and click "Override all Master Page Items". Run the script!
If you add new pages, only need to override them and run the script again 

Similar Messages

  • Automatic numbering - not with actual page number

    I am doing a book that has aboubt 20 pages and then about 100 with recipes. I want to have a heading with Day 1, Day 2, Day3. I will be appying a master page to the recipes, but I want to do an automatic day number. If I do the insert page it labels it to the actual page number. Any way I can do this? CS4

    You can set any starting page number you like, in the Pages panel under "Sections and Numbering".
    InDesign will complain if you already have pages numbered "1", "2", "3" (and you probably have, since you didn't know how to change the page numbering). It's correct in complaining too, because what page should it print if you type in "1" in the Print Dialog? Two further options, here: use absolute numbering (which is the real, actual page n in your document, irregardless of what it shows as "the" page number); or set the initial part of your text to be numbered in Roman numerals, so they count "i", "ii", "iii", and your Days will be numbered as usual. (Uh, with that I mean the page numbers.) Changing the numbering to Roman is also in the Pages panel menu.

  • Shows address bar etc. but won't show the actual page, except in "full screen"u

    When I launch firefox it only shows address bar etc. but won't show the actual page, except in "full screen" view. My OS is Windows Vista.
    In other words, I get the top menu bars and the rest of the screen show my desktop background.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions 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
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • How can I add a Progress bar to show the "render to JPG" progress?

    Hi everyone, I have a button which renders my component to
    JPG.
    How can I attach a progress bar to show the progress of the
    rendering?
    <mx:Button label="render" click="renderasJPEG ()"/>
    public function renderasJPEG( ):void
    convertToImage( component001, new JPEGEncoder( 100));
    private function convertToImage( object:IUICompon ent,
    encoder:IImageEncod er):void
    var base64string: String = ImageSnapshot. encodeImageAsBas
    e64(
    ImageSnapshot. captureImage( object, 72, encoder));
    var variables:URLVariab les = new URLVariables( );
    variables.encoded = base64string;
    variables.type = "jpeg";
    var request:URLRequest = new URLRequest(" script_saveasima
    ge.php");
    request.method = "POST";
    request.data = variables;
    navigateToURL( request, "_blank");
    Thanks in advance.

    Hi,
    I would have thrown a prompt to the user in the renderasJpeg
    function and removed it in last line of convertToImage function.
    Isn't this what you want?
    Hope this helps.

  • Epson Artisan 810 in duplex printing, reverses the second page, so that it is upside down in relation to the first page. Does anyone know how to set the second page i.e the reverse side of the page, in the correct direction?in the

    Epson Artisan 810 in duplex printing, reverses the second page, so that it is upside down in relation to the first page. Does anyone know how to set the second page.... i.e the reverse side of the page.....in the correct direction?
    It worked perfectly last week, now there are problems.
    Thanks for any advice.

    Epson Artisan 810 in duplex printing, reverses the second page, so that it is upside down in relation to the first page. Does anyone know how to set the second page.... i.e the reverse side of the page.....in the correct direction?
    It worked perfectly last week, now there are problems.
    Thanks for any advice.

  • I'm using FF for Mac 3.6.13 and everytime I open a new window or tab the image of what I see is tiny which requires me to click Command + to enlarge it. The actual page is normal size, but its the image of the page that opens tiny.

    I'm using FF for Mac 3.6.13 and every time I open a new window or tab the image of what I see is tiny which then requires me to click Command + to enlarge it about 4 or 5 times. The actual page is normal size, but its the image (what I see) of the page that is tiny.

    Thanks but Command 0 on a Mac only makes a temporary change to that one page. The link you provided doesn't show how to make a permanent change. Do you know how to permanently change this so I don't have to do it to every new page?
    Thank you.

  • I just turned on my Apple Macbook pro. Whenever, I turn it on, the progress bar comes with the Apple symbol and after few secs, it turns off by itself. Have tried to turn on the MBP number of times but the same result

    I just turned on my Apple Macbook pro. Whenever, I turn it on, the progress bar comes with the Apple symbol and after few secs, it turns off by itself. Safe mode on start up does not work either...any ideas?

    i tried it with both. i have since tried control+R, (https://discussions.apple.com/thread/3730727?start=0&tstart=0) which appears to be doing something but wont let me repair anything..

  • How to know the total page number of the standard report

    How to know the total page number of the standard report?
    If I insert a graph, a table, or text into the end of the standard report, how to know how much space is left for the current page?

    Hello Net,
    Unfortunately, we do not have any VIs in LabVIEW that can figure out the number of pages of a standard report. However, with the use of ActiveX calls you can achieve this task. Here are a couple of discussion forums which discuss this:
    Excel Page Numbering with ActiveX:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=194479&requireLogin=False
    Number Pages in Word Report:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=162972&requireLogin=False
    There is also great documentation on using ActiveX on msdn. You can search this document for page number objects. Here is a link to this:
     http://msdn2.microsoft.com/en-us/library/aa223048(​office.11).aspx
    Please refer to these links. If you still have questions please feel free to let us know so we can assist you.
    Thank you
    Best Regards,
    Dominic L.

  • Is there any way to link page number with the reference page number within text in InDesign CC and CS6?

    Is there any way to link page number with the reference page number within text in InDesign CC and CS6?

    You should ask in InDesign
    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Generalizing the return page number when linking to a page in another app

    Hello.
    I know how to link to a page in another app within the same workspace. However, my problem arises when the user tries to go back to the page in the first app.
    Is there a way to "generalize" the "return path". I do not want to hard-code the return page number within a "back link" element on the target page. I was wondering if there is some sort of substitution string I can use in the return http address that automatically "knows" what the returning page number is. Hope I'm making sense here.
    Thanks for any help/advice.

    Funky:
    I have tried some work but no success
    I don't know what you are asking of me. I have given detailed step-by-step instructions on how to implement what I suggested earlier on in this thread. Look at my postings on 9/13/2006. What part are you having trouble with?
    Could you be more specific?
    I'm afraid I am going to have to ask you the same question.
    if page is not submited (called through Tab)
    Apex standard tabs do submit the page and fire after-submit computations defined on the calling page before branching to the "current" page for the tab you click on.

  • Need to delete the old page number from a combined file and replace it with the new number. is there a way for me to do that using JavaScipt

    is there a way of using JS to delete the old page number (1,3,32,78) on a combined PDF and inset it with a new page numbers (1,2,3,4) Thank you

    Depends. If the page numbers can be located by their location on the page then a script can be written to redact that area, and then add new page numbers in their place (or somewhere else).

  • Pdf reader that will let me print the current page number to stdout ?

    I'm looking into annotating my readings, and it'd really speed things up if I were able to get the current page number printed to stdout.
    I've been through evince and xpdf's manuals, the latter will let you output the file to ps, so there might be some hacking possible there, but maybe there is a more convenient alternative...?
    Would appreciate some suggestions.
    Cheers !

    Sure that works, it's just that I'm already wrapping my pdf reader in a ruby script to allows me to make annotations linking back to the original document and page, and I also use the clipboard to quote.
    So instead of being a keybinding away, I end up have to juggle with windows...

  • Relation between the two pernonnel number  country reassignments

    According to the documentation of SAP
    After you have made country reassignments, you can display the personnel numbers using the Display HR Master Data (PA20) or Maintain HR Master Data (PA30) transactions then
    Extras   Country assignments, however the relation no is created.
    I execute the report RHHANDLERELATIONS, but not solve the issue.
    Someone     know which the system not do this relation between the two pernonnel number?
    Regards

    Issue No solved

  • Progress bar/Icon before the page loads

    Hi,
    I am having a page which takes 1-2 mins to load and render the data now i want to display animated icon/progress-bar immediately the page pops up(ie. when blank). Ive already done progress bar on the page load but in this case i want it to display much early when the page is still blank, any idea please. If this is not doable in Apex i might borrow JS/JQuery......thanks all.

    All,
    I got this issue to work in a better way using Skillbuilder's pop-up plugins but again I am having issue with that too as described below,
    The first time the popup page comes up the background is totally black, how can i change this to make it meaningful color?
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    workspace=proj2010
    userid/pwd=demo/demo123
    thanks in advance.
    Edited by: jieri on Jul 30, 2012 1:18 PM

  • Firefox menu bar appears- file/edit/history etc but the actual page with the search bar does not appear and is blank

    when clicking firefox icon to open the internet, all that appears are the options along the top of the page. the rest of the screen does not appear revealing the desktop picture. The firefox page with the search bar does not appear.
    http://imageshack.us/photo/my-images/214/screenshot20120303at155.png/

    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings and disables most add-ons (extensions and themes).
    ''(If you're using an added theme, switch to the Default theme.)''
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu by clicking on the '''Restart with Add-ons Disabled...''' menu item:<br>
    [[Image:FirefoxSafeMode|width=520]]<br><br>
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

Maybe you are looking for

  • How to restore a Web Gallery from my backu

    I noticed today that one of my Web Galleries was gone. I'm sure I didn't delete it. I entered into Time Machine while still in iPhoto '08 and stepped back in time until the missing Web Gallery showed up. Apparently it got "deleted" a few days ago but

  • HT1320 I tried all the steps to reset my nano 6th generation and it still won't turn on. What do I do then?

    I tried all the steps to reset my nano 6th generation and it still won't turn on. I've had this since February and just started having problems about a week ago after I charged it. Now I can sometimes get it to turn on but mostly it just stays off, I

  • Bluetooth printer is seen, but doesn't pair

    My bluetooth mouse and keyboard work fine, but I am having trouble with the bluetooth connection to a Canon Pixma MP810 printer. I ran the bluetooth setup for the printer, which seemed to complete satisfactorily in the same way as it did for the mous

  • How do I change the noise at start up?

    I remember changing the noise my Mac makes when I turn it on when I first bought it, but I can no longer remember how to do so. Could someone please tell me where I can find the option. Thanks

  • Delta in Genaric extractin

    Hello gurus, I have done generic extraction on table OSMON, the feild which i have included in are, SERVER(Server name)                                           1,ADATE(Date of analysis)                              2,CPUMAX(Max. CPU usage for 1 day