How can add a progress bar into script?

Hi,
I got a script for gen pdf
I want put a progress bar, and make it working
but I don't know where I can put the progress bar
and how
//=====================================================================
var doc = app.documents; 
app.findTextPreferences = null; 
app.findTextPreferences.underline = true; 
for(var i=0;i<doc.length;i++) 
        var found = doc[i].findText(); 
        var _pages = []; 
        for(var j=0;j<found.length;j++) 
                var txfms = found[j].texts[0].parentTextFrames; 
                for(var k=0;k<txfms.length;k++) 
                        _pages.push(txfms[k].parentPage.name); 
        for(var j=0;j<_pages.length;j++) 
                if(_pages[j] === _pages[j-1]) 
                        _pages.splice(j,1); 
        if(_pages.length != 0) 
                app.pdfExportPreferences.pageRange = _pages.toString(); 
                doc[i].exportFile(ExportFormat.PDF_TYPE, new File(doc[i].fullName.toString().replace(/\.indd$/i,".pdf")), false); 
        _pages = []; 
//=================================================================== Can I put progress bar in here?
           var counter = new Window("palette");
           counter.prompt = counter.add("statictext",[0,0,80,20]);
           counter.show();
           var cells = app.activeDocument.allCellStyles;
           for(var i = cells.length-1; i > 0; i--){
           counter.prompt.text = String(i);
           cells[i].verticalJustification = VerticalJustification.bottomAlign;
           counter.close();
//===================================================================
app.findTextPreferences = null;
alert("Done.");
thanks
Harvey

Hi Harvey,
Try this,
var doc = app.documents;
app.findTextPreferences = null;
app.findTextPreferences.underline = true;
for(var i=0;i<doc.length;i++)
        var found = doc[i].findText();
        var _pages = [];
        for(var j=0;j<found.length;j++)
                var txfms = found[j].texts[0].parentTextFrames;
                for(var k=0;k<txfms.length;k++)
                        _pages.push(txfms[k].parentPage.name);
        for(var j=0;j<_pages.length;j++)
                if(_pages[j] === _pages[j-1])
                        _pages.splice(j,1);
        if(_pages.length != 0)
                app.pdfExportPreferences.pageRange = _pages.toString();
                doc[i].exportFile(ExportFormat.PDF_TYPE, new File(doc[i].fullName.toString().replace(/\.indd$/i,".pdf")), false);
        _pages = [];
    var counter = new Window("palette");
    counter.prompt = counter.add("statictext",[0,0,80,20]);
    counter.show();
    var cells = app.activeDocument.allCellStyles;
    var w = new Window('palette');
    w.pbar = w.add('progressbar', undefined, 0, cells.length);
    w.pbar.preferredSize.width = 300;
    w.show();
    w.pbar.value = 0;
    for(var i = cells.length-1; i > 0; i--)
        w.pbar.value += 1;
        counter.prompt.text = String(i);
        cells[i].verticalJustification = VerticalJustification.bottomAlign;
    counter.close();
app.findTextPreferences = null;
alert("Done.");
Regards,
Chinna

Similar Messages

  • How can i use Progress bar in IR Report

    Hi ,
    I have created IR Report based on the View so, it's been taking 10-15 mins of time to execute the IR Report. Here user want to see the Progress bar while executing the IR Report. How can i use Progress bar in IR Report.
    Anybody have idea on Progress bar please help me.
    Regards
    Narender B

    Hi ,
    Thanks for your information.
    I am new to the APEX.*i need to show Progress bar while opening the each page* then user can know some process is happening from the backside and i don't know where i need to add and call the below function.could you please provide the steps for the progress bar.
    In my application there are almost 100 pages are there so, i need to show progress bar on each page while opening .could you please provide Global function to call on each page.
    function html_url_Progress(pThis){ 
    $x_Show('AjaxLoading');
    window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 100);
    //doSubmit('APPLY_CHANGES');
    redirect(pUrl);
    Regards
    Narender B

  • Script : How to add a progress bar to XMP Writing script ?

    Hi !
    I have this script that works flawlessly but when i execute it on big video files ( > 1GB) bridge doesn't repaint and it looks like it's stuck. I would like to have a progress bar showing % remaining on the task and the name of the file being treated. Can someone point me into the right direction as my adobe scripting knowledge is not that great.
    #target bridge  
    if( BridgeTalk.appName == "bridge" ) { 
    descToTitle = MenuElement.create("command", "Log Comment to Description", "at the end of Tools");
    descToTitle.onSelect = function () {
               if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
               var thumb = app.document.selections;
               for(var s in thumb){
                         if(thumb[s].hasMetadata){
                                            var selectedFile = thumb[s].spec;
                                            var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
                                            var myXmp = myXmpFile.getXMP();
                                            var LogComment = myXmp.getProperty(XMPConst.NS_DM, "logComment");
                                            myXmp.deleteProperty(XMPConst.NS_DC, "description");
                                            myXmp.appendArrayItem(XMPConst.NS_DC, "description", LogComment, 0, XMPConst.ALIAS_TO_ALT_TEXT);
                                            myXmp.setQualifier(XMPConst.NS_DC, "description[1]", "http://www.w3.org/XML/1998/namespace", "lang", "x-default");
                                            if (myXmpFile.canPutXMP(myXmp)) {
                                            myXmpFile.putXMP(myXmp);
                                            myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
                                             } else {
                          xmpFile.closeFile();
    Thx in advance for helping me !

    I am using this progress bar on bridge. I don't remember who gave it to me time ago.
    Anyway I have adapt it to your script:
    #target bridge  
    if( BridgeTalk.appName == "bridge" ) { 
    descToTitle = MenuElement.create("command", "Log Comment to Description", "at the end of Tools");
    descToTitle.onSelect = function () {
        if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
        var thumb = app.document.selections;
        var progBar = new createProgressWindow("Work in Progress", "Please wait", false);
        for (var s in thumb) {
            if(thumb[s].hasMetadata) {
                var selectedFile = thumb[s].spec;
                var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
                var myXmp = myXmpFile.getXMP();
                var LogComment = myXmp.getProperty(XMPConst.NS_DM, "logComment");
                myXmp.deleteProperty(XMPConst.NS_DC, "description");
                myXmp.appendArrayItem(XMPConst.NS_DC, "description", LogComment, 0, XMPConst.ALIAS_TO_ALT_TEXT);
                myXmp.setQualifier(XMPConst.NS_DC, "description[1]", "http://www.w3.org/XML/1998/namespace", "lang", "x-default");
            progBar.updateProgress (Math.floor((Number(s)+1)*(100/thumb.length)), "Waiting, " + Math.floor((Number(s)+1)*(100/thumb.length)) + "% completed.");
            if (myXmpFile.canPutXMP(myXmp)) {
                myXmpFile.putXMP(myXmp);
                myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
            } else {
                xmpFile.closeFile();
    function createProgressWindow(title, message, hasCancelButton) {
        var win;
        if (title == null) title = "Work in progress";
        if (message == null) message = "Please wait...";
        if (hasCancelButton == null) hasCancelButton = false;
        win = new Window("palette", "" + title, undefined);
        win.bar = win.add("progressbar", {x: 20,y: 12,width: 300,height: 20}, 0, 100);
        win.stMessage = win.add("statictext", {x: 10,y: 36,width: 320,height: 20}, "" + message);
        win.stMessage.justify = 'center';
        if (hasCancelButton) {
            win.cancelButton = win.add('button', undefined, 'Cancel');
            win.cancelButton.onClick = function() {
                win.close();
                throw new Error('User canceled the pre-processing!');
        this.reset = function(message) {
            win.bar.value = 0;
            win.stMessage.text = message;
            return win.update();
        this.updateProgress = function(perc, message) {
            if (perc != null) {
                win.bar.value = perc;
            if (message != null) {
                win.stMessage.text = message;
        return win.update();
        this.close = function() {
            return win.close();
        win.center(win.parent);
        return win.show();

  • How to use a progress bar with java mail?

    Hi, i'm new here.
    I want if someone can recommend me how to show a progress bar with java mail.
    Because, i send a message but the screen freeze, and the progress bar never appear, after the send progress finish.
    Thanks

    So why would the code we post be any different than the code in the tutorial? Why do you think our code would be easier to understand? The tutorial contains explanations about the code.
    Did you download the code and execute it? Did it work? Then customize the code to suit your situation. We can't give you the code because we don't know exactly what you are attempting to do. We don't know how you have changed to demo code so that it no longer works. Its up to you to compare your code with the demo code to see what the difference is.

  • How can add captions or title to a picture now that iPhoto doesn't work after updating to iOS 8.

    I Have updated to iOS 8 and iPhoto is dismissed. How can add a caption /title (not in the image) like I was used with iPhoto? Photos has not this feature.
    please, could anyone help me. I'm a real beginner. Thanks,

    I Have updated to iOS 8 and iPhoto is dismissed. How can add a caption /title (not in the image) like I was used with iPhoto? Photos has not this feature.
    please, could anyone help me. I'm a real beginner. Thanks,
    The photos.app does not (yet) have the option to add captions or tags. It is not possible right now. You can however search for the captions you added previously using the search field.  You can also search for album names.  So, as a work-around, put photos that should have the same caption into an album with a name like the caption.
    See:  Migrating from iPhoto for iOS to Photos on iOS 8
    You may want to send feedback to Apple, that captions and tags are essential and need to be added in an update. Use this form:   Apple - iPhoto - Feedback

  • How to add more disk space into /   root file system

    Hi All,
    Linux  2.6.18-128
    can anyone please let us know how to add more disk space into "/" root file system.
    i have added new hard disk with space of 20GB, 
    [root@rac2 shm]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda1             965M  767M  149M  84% /
    /dev/hda7             1.9G  234M  1.6G  13% /var
    /dev/hda6             2.9G   69M  2.7G   3% /tmp
    /dev/hda3             7.6G  4.2G  3.0G  59% /usr
    /dev/hda2              18G   12G  4.8G  71% /u01
    LABLE=/               2.0G     0  2.0G   0% /dev/shm
    /dev/hdb2             8.9G  149M  8.3G   2% /vm
    [root@rac2 shm]#

    Dude! wrote:
    I would actually question whether or not more disks increase the risk of a disk failure. One disk can break as likely as one of two of more disks.
    Simple stats.  Buying 2 lottery tickets instead of one, gives you 2 chances to win the lottery prize. Not 1. Even though the odds of winning per ticket remains unchanged.
    2 disks buy you 2 tickets in The-Drive-Failure lottery.
    Back in the 90's, BT (British Telecom) had a 80+ node OPS cluster build with Pyramid MPP hardware. They had a dedicated store of scsi disks for replacing failed disks - as there were disk failure fairly often due to the number of disks. (a Pryamid MPP chassis looked like a Xmas tree with all the scsi drive LEDs, and BT had several)
    In my experience - one should rather expect a drive failure sooner, than later. And have some kind of contingency plan in place to recover from the failure.
    The use of symbolic links instead of striping the filesystem protects from the complete loss of the enchilada if a volume member fails, but it does not reduce the risk of loosing data.
    I would rather buy a single ticket for the drive failure lottery for a root drive, than 2 tickets in this case. And using symbolic links to "offload" non-critical files to the 2nd drive means that its lottery ticket prize is not a non-bootable server due to a toasted root drive.

  • How can I embed a song into a keynote presentation?

    how can I embed a song into a keynote presentation?

    (From Keynote Help)
    Adding Sound to an Individual Slide
    Sound added to an individual slide plays only on the slide to which it’s been added.
    Here are ways to add sound to a slide: 
    Drag a sound file from the Finder anywhere onto the slide canvas or to a media placeholder.
    Click Media in the toolbar, choose iTunes in the Audio pane of the Media Browser, select a playlist, and then drag a file or playlist anywhere onto the slide canvas (including to a media placeholder).
    The sound file is represented on the slide canvas by a speaker icon, but this icon doesn’t appear when you play the slideshow.
    You can start and stop sound playback at any time while the slide is showing. When you advance to the next slide, the sound playback automatically stops. To control when the music starts and stops, select the sound file icon, and then set playback options and use the Start Audio and Stop Audio effects in the Build Inspector. For more information, see Adjusting Media Playback Settings and Creating Movie Builds.
    When you add media files to your slideshow, make sure that they will be available if you transfer your document to another computer. When saving your document, make sure to select “Copy audio and movies into document” in the Save window after you choose Save or Save As. (If you don’t see the option, click the disclosure triangle next to the field, and then click Advanced Options.)
    Also note that some media files are protected under copyright law. Some downloaded music may be played only on the computer where the download occurred. Make sure the computer you’re using has permission to play all the media files included in your slideshow.

  • How can I convert a layer into a smart object with Adobe Photoshop Elements 10?

    How can I convert a layer into a smart object with Adobe Photoshop Elements 10?

    That feature is only in PS. Elements as you buy it has only limited support for smart objects. If you use File>Place to add something to your image it will come in as a smart object (within the limits to which PSE understands smart layers). However, if you know someone who can write an action for you in PS you can install it in PSE, or you could look into something like elements+ from simplephotoshop.com.

  • How can i move several emails into folders in ipad?

    How can i move several emails into folders in ipad?

    You can sort by using the search feature. When you are in your mail account you use the search bar at the top to find emails from a particular sender (there are Other options as well in search). Type in that sender's address. When the emails show up in the window on the left side, select all of the emails that you want to move. Tap Edit at the bottom and the Move Folder icon will appear. Tap that icon and select the folder that you want to move the emails into.
    To move multiple emails without using the search to sort, go to your inbox and tap Edit. Then select all of the emails that you want to move. After you are done selecting them, tap the Move icon at the bottom on the left side of the account window. When you tap move, you get a choice of folder into which you can place the selected emails.

  • How can i put below  table into internalt table

    how can i put below  table into internalt table and want to add both internal table into 3rd internal table.
    SELECT  * FROM J_1IEXCHDR  WHERE STATUS = 'P'.
    WRITE: / J_1IEXCHDR-LIFNR,
              J_1IEXCHDR-DOCNO,
              J_1IEXCHDR-EXYEAR,
              J_1IEXCHDR-BUDAT.
    SELECT * FROM J_1IEXCDTL  WHERE TRNTYP = J_1IEXCHDR-TRNTYP
                              AND DOCYR  = J_1IEXCHDR-DOCYR
                              AND DOCNO  = J_1IEXCHDR-DOCNO.
       WRITE: / J_1IEXCDTL-EXBAS,
                J_1IEXCDTL-EXBED,
                J_1IEXCDTL-RDOC1,
                J_1IEXCDTL-ECS.
    ENDSELECT.
    ENDSELECT.
    please help
    thanks in adavaced.

    hi laxman,
    use for all entries and get the required data.
    SELECT * FROM J_1IEXCHDR into table itab1 WHERE STATUS = 'P'.
    if not itab1[] is initial.
    SELECT * FROM J_1IEXCDTL into table itab2 for all entries in itab1 WHERE TRNTYP = itab1-TRNTYP
    AND DOCYR = itab1-DOCYR
    AND DOCNO = itab1-DOCNO.
    endif.
    so itab2 will have the common records...This will solve ur problem..
    also u can do other method declare an final internal table with the common fields of the two internal table.
    then after getting data in itab1 and itab2.
    loop at itab1.
    move-corresponding itab1 to itab3.
    read table itab2 with key <give the fields> = ......
    if sy-subrc eq 0.
    move-corresponding itab2 to itab3.
    endif.
    append itab3.
    endloop.
    Regards,
    nagaraj

  • How can i rewrite this code into java?

    How can i rewrite this code into a java that has a return value?
    this code is written in vb6
    Private Function IsOdd(pintNumberIn) As Boolean
        If (pintNumberIn Mod 2) = 0 Then
            IsOdd = False
        Else
            IsOdd = True
        End If
    End Function   
    Private Sub cmdTryIt_Click()
              Dim intNumIn  As Integer
              Dim blnNumIsOdd     As Boolean
              intNumIn = Val(InputBox("Enter a number:", "IsOdd Test"))
              blnNumIsOdd = IsOdd(intNumIn)
              If blnNumIsOdd Then
           Print "The number that you entered is odd."
        Else
           Print "The number that you entered is not odd."
        End If
    End Sub

    873221 wrote:
    I'm sorry I'am New to Java.Are you new to communication? You don't have to know anything at all about Java to know that "I have an error," doesn't say anything useful.
    I'm just trying to get you to think about what your post actually says, and what others will take from it.
    what does this error mean? what code should i replace and add? thanks for all response
    C:\EvenOdd.java:31: isOdd(int) in EvenOdd cannot be applied to ()
    isOdd()=true;
    ^
    C:\EvenOdd.java:35: isOdd(int) in EvenOdd cannot be applied to ()
    isOdd()=false;
    ^
    2 errors
    Telling you "what code to change it to" will not help you at all. You need to learn Java, read the error message, and think about what it says.
    It's telling you exactly what is wrong. At line 31 of EvenOdd.java, you're calling isOdd(), with no arguments, but the isOdd() method requires an int argument. If you stop ant think about it, that should make perfect sense. How can you ask "is it odd?" without specifying what "it" is?
    So what is this all about? Is this homework? You googled for even odd, found a solution in some other language, and now you're just trying to translate it to Java rather than actually learning Java well enough to simply write this trivial code yourself?

  • How can i write a string into a specified pos of a file?

    How can i write a string into a specified pos of a file without read all file into ram and write the whole file again?
    for example:
    the content of file is:
    name=123
    state=456
    i want to modify the value of name with 789
    (write to file without read all file into ram)
    How can i do it? thank you

    take this as an idea. it actually does what i decribed above. you sure need to make some modifications so it works for your special need. If you use it and add any valuable code to it or find any bugs, please let me know.
    import java.io.*;
    import java.util.*;
    * Copyright (c) 2002 Frank Fischer <[email protected]>
    * All rights reserved. See the LICENSE for usage conditions
    * ObjectProperties.java
    * version 1.0, 2002-09-12
    * author Frank Fischer <[email protected]>
    public class ObjectProperties
         // the seperator between the param-name and the value in the prooperties file
         private static final String separator = "=";
         // the vector where we put the arrays in
         private Vector PropertiesSet;
         // the array where we put the param/value pairs in
         private String propvaluepair[][];
         // the name of the object the properties file is for
         public String ObjectPropertiesFileName;
         // the path to the object'a properties file
         public String ObjectPropertiesDir;
         // reference to the properties file
         public File PropertiesFile;
         // sign for linebreak - depends on platforms
         public static final String newline = System.getProperty("line.separator");
         public ObjectProperties(String ObjectPropertiesFileName, String ObjectPropertiesDir, ObjectPropertiesManager ObjectPropertiesManager)
         //     System.out.println("Properties Objekt wird erzeugt: "+ObjectPropertiesFileName);
              this.ObjectPropertiesFileName = ObjectPropertiesFileName;
              this.ObjectPropertiesDir = ObjectPropertiesDir;
              // reference to the properties file
              PropertiesFile = new File(ObjectPropertiesDir+ObjectPropertiesFileName);
              // vector to put the param/value pair-array in
              PropertiesSet = new Vector();
         //     System.out.println("Properties File Backup wird erzeugt: "+name);
              backup();
         //     System.out.println("Properties File wird eingelesen: "+PropertiesFile);
              try
                   //opening stream to file for read operations
                   FileInputStream FileInput = new FileInputStream(PropertiesFile);
                   DataInputStream DataInput = new DataInputStream(FileInput);
                   String line = "";
                   //reading line after line of the properties file
                   while ((line = DataInput.readLine()) != null)
                        //just making sure there are no whitespaces at the beginng or end of the line
                        line = cutSpaces(line);
                        if (line.length() > 0)
                             //$ indicates a param-name
                             if (line.startsWith("$"))
                                  // array to store a param/value pair in
                                  propvaluepair = new String[1][2];
                                  //get the param-name
                                  String parameter = line.substring(1, line.indexOf(separator)-1);
                                  //just making sure there are no whitespaces at the beginng or end of the variable
                                  parameter = cutSpaces(parameter);
                                  //get the value
                                  String value = line.substring(line.indexOf(separator)+1, line.length());
                                  //just making sure there are no whitespaces at the beginng or end of the variable
                                  value = cutSpaces(value);
                                  //put the param-name and the value into an array
                                  propvaluepair[0][0] = parameter;
                                  propvaluepair[0][1] = value;
                             //     System.out.println("["+ObjectPropertiesFileName+"] key/value gefunden:"+parameter+";"+value);
                                  //and finaly put the array into the vector
                                  PropertiesSet.addElement(propvaluepair);
              // error handlig
              catch (IOException e)
                   System.out.println("ERROR occured while reading property file for: "+ObjectPropertiesFileName);
                   System.out.println("ERROR CODE: "+e);
                   // System.out.println("in ObjectProperties");
         // function to be called to get the value of a specific paramater 'param'
         // if the specific paramater is not found '-1' is returned to indicate that case
         public String getParam(String param)
              // the return value indicating that the param we are searching for is not found
              String v = "-1";
              // looking up the whole Vector
              for (int i=0; i<PropertiesSet.size(); i++)
                   //the String i want to read the values in again
                   String s[][] = new String[1][2];
                   // trying to get out the array from the vector again
                   s = (String[][]) PropertiesSet.elementAt(i);
                   // comparing the param-name we're looking for with the param-name in the array we took out the vector at position i
                   if (s[0][0].equals(param) == true)
                        //if the param-names are the same, we look up the value and write it in the return variable
                        v = s[0][1];
                        // making sure the for loop ends
                        i = PropertiesSet.size();
              // giving the value back to the calling procedure
              return v;
         // function to be called to set the value of a specific paramater 'param'
         public void setParam(String param, String value)
              // looking up the whole Vector for the specific param if existing or not
              for (int i=0; i<PropertiesSet.size(); i++)
                   //the String i want to read the values in again
                   String s[][] = (String[][]) PropertiesSet.elementAt(i);
                   // comparing the param-name we're looking for with the param-name in the array we took out the vector at position i
                   if (s[0][0].equals(param) == true)
                        //if the param-names are the same, we remove the param/value pair so we can add the new pair later in
                        PropertiesSet.removeElementAt(i);
                        // making sure the for loop ends
                        i = PropertiesSet.size();
              // if we land here, there is no such param in the Vector, either there was none form the beginng
              // or there was one but we took it out.
              // create a string array to place the param/value pair in
              String n[][] = new String[1][2];
              // add the param/value par
              n[0][0] = param;
              n[0][1] = value;
              // add the string array to the vector
              PropertiesSet.addElement(n);
         // function to save all data in the Vector to the properties file
         // must be done because properties might be changing while runtime
         // and changes are just hold in memory while runntime
         public void store()
              backup();
              String outtofile = "# file created/modified on "+createDate("-")+" "+createTime("-")+newline+newline;
              try
                   //opening stream to file for write operations
                   FileOutputStream PropertiesFileOuput = new FileOutputStream(PropertiesFile);
                   DataOutputStream PropertiesDataOutput = new DataOutputStream(PropertiesFileOuput);
                   // looping over all param/value pairs in the vector
                   for (int i=0; i<PropertiesSet.size(); i++)
                        //the String i want to read the values in
                        String s[][] = new String[1][2];
                        // trying to get out the array from the vector again
                        s = (String[][]) PropertiesSet.elementAt(i);
                        String param = "$"+s[0][0];
                        String value = s[0][1];
                        outtofile += param+" = "+value+newline;
                   outtofile += newline+"#end of file"+newline;
                   try
                        PropertiesDataOutput.writeBytes(outtofile);
                   catch (IOException e)
                        System.out.println("ERROR while writing to Properties File: "+e);
              catch (IOException e)
                   System.out.println("ERROR occured while writing to the property file for: "+ObjectPropertiesFileName);
                   System.out.println("ERROR CODE: "+e);
         // sometimes before overwritting old value it's a good idea to backup old values
         public void backup()
              try
                   // reference to the original properties file
                   File OriginalFile = new File(ObjectPropertiesDir+ObjectPropertiesFileName);
                   File BackupFile = new File(ObjectPropertiesDir+"/backup/"+ObjectPropertiesFileName+".backup");
                   //opening stream to original file for read operations
                   FileInputStream OriginalFileInput = new FileInputStream(OriginalFile);
                   DataInputStream OriginalFileDataInput = new DataInputStream(OriginalFileInput);
                   //opening stream to backup file for write operations
                   FileOutputStream BackupFileOutput = new FileOutputStream(BackupFile);
                   DataOutputStream BackupFileDataOutput = new DataOutputStream(BackupFileOutput);
              //     String content = "";
                   String line = "";
                   // do till end of file
                   while ((line = OriginalFileDataInput.readLine()) != null)
                        BackupFileDataOutput.writeBytes(line+newline);
              // error handlig
              catch (IOException e)
                   System.out.println("ERROR occured while back up for property file: "+ObjectPropertiesFileName);
                   System.out.println("ERROR CODE: "+e);
                   System.out.println("this is a serious error - the server must be stopped");
         private String cutSpaces(String s)
              while (s.startsWith(" "))
                   s = s.substring(1, s.length());
              while (s.endsWith(" "))
                   s = s.substring(0, s.length()-1);
              return s;
         public String createDate(String seperator)
              Date datum = new Date();
              String currentdatum = new String();
              int year, month, date;
              year = datum.getYear()+1900;
              month = datum.getMonth()+1;
              date = datum.getDate();
              currentdatum = ""+year+seperator;
              if (month < 10)
                   currentdatum = currentdatum+"0"+month+seperator;
              else
                   currentdatum = currentdatum+month+seperator;
              if (date < 10)
                   currentdatum = currentdatum+"0"+date;
              else
                   currentdatum = currentdatum+date;
              return currentdatum;
         public String createTime(String seperator)
              Date time = new Date();
              String currenttime = new String();
              int hours, minutes, seconds;
              hours = time.getHours();
              minutes = time.getMinutes();
              seconds = time.getSeconds();
              if (hours < 10)
                   currenttime = currenttime+"0"+hours+seperator;
              else
                   currenttime = currenttime+hours+seperator;
              if (minutes < 10)
                   currenttime = currenttime+"0"+minutes+seperator;
              else
                   currenttime = currenttime+minutes+seperator;
              if (seconds < 10)
                   currenttime = currenttime+"0"+seconds;
              else
                   currenttime = currenttime+seconds;
              return currenttime;

  • I have written an ebook that has been created for kindle. How can I export the book into iBooks author?

    I have written an ebook that has been created for kindle. How can I export the book into iBooks Author?
    I have tried converting the book to different files like, mobi, epub, pdf. By using an app on my iphone.
    I still cannot add it to iBooks Author.
    I'm stuck, Please help me!

    Either use copy/paste and then format/style as desired, or take it to Pages or WORD and insert chapters - which may still require resettling.
    If you're looking for a 1:1 port, with all styles and layout intact, you may be dissapointed, tho.

  • I have photos I want to group together in one album, but can't do this because some may have the same number. How can I combine them all into one album?

    I have photos I want to group together in one album, but can't do this because some may have the same number. How can I combine them all into one album? I was trying to move several albums onto a USB drive and it stated all other files exist at this location.  They are pictures taken at different times and have the same number I guess.

    In iPhoto albums may contain photos with the same file name - iPhoto handles that just fine
    If you are exporting them to move somewhere else use the sequential file name feature of export to give each file a unique name
    LN

  • Have multiple accounts, how can I move all products into one account?

    have multiple accounts, how can I move all products into one account?

    Backup Software Recommendations
    Carbon Copy Cloner
    Data Backup
    Deja Vu
    SuperDuper!
    Synk Pro
    Tri-Backup
    Others may be found at VersionTracker or MacUpdate.
    Visit The XLab FAQs and read the FAQ on backup and restore.  Also read How to Back Up and Restore Your Files.
    Or you can simply use the Restore option of Disk Utility to clone the drive to the backup:
    Clone using Restore Option of Disk Utility
    Open Disk Utility from the Utilities folder.
    Select the destination volume from the left side list.
    Click on the Restore tab in the DU main window.
    Check the box labeled Erase destination.
    Select the destination volume from the left side list and drag it to the Destination entry field.
    Select the source volume from the left side list and drag it to the Source entry field.
    Double-check you got it right, then click on the Restore button.
    Destination means the external backup drive. Source means the internal startup drive.

Maybe you are looking for