Question on File naming

When my users create a new file I create a file named untitled, what I would like to do is check for another file named untitled, if there is one I would like to name the file untitled1 sort of like Word or OpenOffice does.
Anyone know how they do this?
Is it by listing all the files checking for there names and then nameing it according
//pseudo code
get list[] of all files in directory
walk thru files in the array checking for untitled
for each one found increment the counter
then name the file untitled+counter

This is what I have so far, it works but I would like comments or suggestions.
Thanks in advance.
int counter = 0;
newFile = true;
File parentDir = new File("./App");
File subDir = new File("./App/untitled");
if(subDir.exists()){
    File files[] = parentDir.listFiles();
    for(int i = 0; i < files.length; i++){
        String fileName = files.getName();
String name = fileName.substring(0, 3 );
System.out.println(name);
// not crazy about this, it works but I can forsee problems
if( name.equals("unt"))
counter++;
subDir = new File("./App/untitled"+String.valueOf(counter));
subDir.mkdir();
else
subDir.mkdir();     

Similar Messages

  • ACS4 file naming

    Well all is working well with the latest ACS4 install. My question is file naming for packaged books.
    I have ebook ISBNxxxxxxx.pdf and after I package the book ACS changes the file name to 2357347534090480686-089.pdf (a real long different name)
    Support mentioned there is a way using the packaging xml for each to specify the file name, but they didnt supply a how to. Does any one know how I can package a book and continue to use the same file name?
    Info:
    my source is a pdf named ISBN.pdf
    I use the -xml -jpg batch packaging command
    Just want the name to remain the same after packaging,
    thanks in advance

    Hi,
    You need to add a ISBNxxxxxx.pdf tag at the level below the package tag in you packaging xml file.
    Regards,
    Rob

  • Help! Distiller 9 API File Naming Question

    Not well versed in options for distiller first off.
    I would like to create a module that when a user is saving a pdf file :
    1). user is prompted to scan the file name from a barcode
    2). a suffix is added to the barcode scan, "-" + either including the users %username% + date/timestamp or from a serial increment file
    basically <barcodescan + "- " + suffix>.pdf for filenaming convention
    is this possible?
    Any help on this is greatly appreciated.
    Thanks
    skrohn

    Trying to automate pdf file creation?  using distiller joboption with vbs..or am I going down the wrong route/
    I was thinking along the lines of::  But... not sure how to incorporate that with the distiller for savng a file.  What we are doing is scanning in documents to create a pdf.  We want the file naming to be :  user scans with a scangun a order# from a barcode and then the a suffix to make it unique to the system is added to the file name.  the pdf file that was just created is then saved with that file name
    Sub GetFileName()
    Dim GetWorkOrder As String
    Dim SaveFile As String
    dtmThisDay = Day(Date)
    dtmThisMonth = Month(Date)
    dtmThisYear = Year(Date)
    dtmThisTime =(Time)
    strSuffixName = "-" & dtmThisYear & dtmThisMonth & dtmThisDay & dtmThisTime
    GetWorkOrder = InputBox("Scan Work Order")
    SaveFile = GetWorkOrder & StrSuffixName
    End Sub

  • CS6 File Naming Question

    Since using CS6, there is something that has changed and has me confused:
    I used to be able to save a document with a different name, and the original name would not change.
    For instance, if I were working on a file named: 'Nature 1', and wanted to save a version of it with another name: 'Nature 2', I would be able to do so and 'Nature 1' would not change.
    Now, it seems, when I do this, 'Nature 1' is renamed 'Nature 2' - it's title overwritten.
    This has caused me to overwrite files when saving because the original name is changed.
    Is there a simple workaround for this?

    Well, I do have Photoshop CS4 on windows and I see no difference in file behavior, but I work differently.
    I would need a step-by-step description of what you do to get this problem to see if I can duplicate it.
    My files already have names when I open them, so if I make a change, File > Save respects that filename and won't change it.
    Where I might get in trouble is File > New, if I type "nature1" in the title box and hit enter opening it up in Photoshop. I then make a few changes and go to File > Save.  There I have a chance to name the file and even change the location. So if I type "nature2" and click Save, I just renamed the file,but I did not overwrite an earlier version.
    Anyway Photoshop CS6 won't overwrite a file without warning you.
    Gene

  • How do I install a file named "firefox_plugin_2.1.1.0720.fzip" ?

    Hi,
    I am trying to install a firefox extension from Foxit software (PDF reader) but firefox always comes back and says it is unable to start anti-virus program
    Then when I get past that the file: how do I install a file named "firefox_plugin_2.1.1.0720.fzip" will not unzip or load into firefox. How do I get the program/extension to load?
    Thank you
    Jsteff
    [email protected]

    Hi and thanks for getting back to me.
    Normally I am able to do most things with Windows and most programs..
    However, I am not able to open the file with Firefox as it wants me to tell it which program to use.
    I have the file on my desktop, but Notepad will not open it.
    Firefox also asks me which program to use when Firefox is asking me "what should firefox do with this file?" That happens after I have gone to Firefox/File/Open file and it gives me the question of what do you want Firefos to do with this file.
    The only choices are to open it or save it.
    My problem is I do not know which program to select to open it.
    So which program should I use?
    Very sorry and thank you again.
    Jsteff
    [email protected]

  • File naming

    I'm new to the Mac, new to Aperture 3 (running Trial at the moment). Came from PC and PS CS2 and Adobe Bridge. I have most of my pics in folders organized by date (2008-01-13) and inside the folders, the pics have their original file names - img7832.cr2, etc.
    Upon importing (I've just tried a few folders), I choses a naming scheme such as Boston2008-01-13_img7832.cr2. I left unchecked the rename Masters because I wasn't sure if that was a good idea or not. What do you think of this naming scheme? Or would you toss out the original file name and put the date in front - such as 2008-01-13_Boston. I'm kind of at a loss as to what down the road is going to be most beneficial when it comes to locating photos or to sorting methods. Are underscores necessary between the various components? I do mostly travel and nature photography and and have generally keyworded in the past to find my pictures. I've scanned forums, etc., but haven't found any really good advice on this. I'd appreciate any thoughts
    Reading a bit further, maybe a counter is what I need, such as 2008-01-13Boston001, etc. If I understand that correctly, as I import further pictures to that project, they will just continue the counter (002,003,etc). I only need to remember to reset the counter if I'm going to import into a different project (assuming I don't already have pics in the other project, in which case I would start the counter with the last number in the project + 1).
    And returning to the date issue - is there a benefit in having the Date fields at the beginning of the file name? If you were searching for dates, wouldn't the search pull from the date info that is already inside the picture file?
    Again, I'm asking for those with some years of experience under their belts, as to their opinions and any downfalls they see with my various schemes.
    I should also mention that I'm thinking about letting Aperture "manage" the files, since I have about 100GB to import and I have a 1TB hard drive. If I run out down the road somewhere (I'll probably be dead before then. , then I'm thinking I can just transfer the library to an external and point to it there.
    Thanks!
    Mark

    Hi Mark. You seem to have this pretty well thought through. I'll tell you what I do, just as foil to better refine your scheme, and then I post some comments further down in-line with your questions.
    I use this Naming Convention every time I import my photos into Aperture:
    (Image Date)_(Custom Name)_(Sequence Number)_(Master File Name).
    I use a Referenced Masters storage system (highly rec'd for all but the most simple installations) with my raw files stored on an external HD. I have Aperture auto-file them by YYYY/MM/DD. I have deliberately built a degree of redundancy into my system. The general idea is that all images should have unique names, and I should be able to roughly identify and exactly re-file an file based on name alone.
    (Image Date)
    Starting with this allows me to easy sort files by file name. It is meaningful and useful to me and to the computer.
    (Custom Name)
    I store all my images in Aperture's Library in Projects based on shoots. Roughly, one Project per shoot. (If I have only two shots in a Project, I don't worry about it. If I have more than 60 (after stacking) I tend to break them into Albums within the Project.) "Custom Name" allows me to input two pieces of information per shoot which are important to me: "Shoot Name" and "Shoot Location". I type these into the field provided at the time of import as " ShootName_ShootLocation ". This allows me to keep a bit of useful descriptive text attached to the file (and available without opening or previewing it or even having it on my machine).
    (Sequence Number)
    Self-explanatory.
    (Master File Name)
    Useful when one has more than one camera at a shoot, and also should anything go wrong during import (I rotate cards and don't re-format them until I put them back in a camera).
    ATHiker95 wrote:
    I'm new to the Mac, new to Aperture 3 (running Trial at the moment). Came from PC and PS CS2 and Adobe Bridge. I have most of my pics in folders organized by date (2008-01-13) and inside the folders, the pics have their original file names - img7832.cr2, etc.
    Important: you are creating two separate filing schemes in your use of Aperture: one for files, and one for images. Imho, there is no reason to use any time- or date-based scheme for your image storage (date and time are hard-tagged to each image and Aperture provides ample tools to sort and filter by date and time (and day and month and year)).
    Upon importing (I've just tried a few folders), I choses a naming scheme such as Boston2008-01-13_img7832.cr2. I left unchecked the rename Masters because I wasn't sure if that was a good idea or not. What do you think of this naming scheme?
    I always rename Masters. There is no reason not to.
    Or would you toss out the original file name and put the date in front - such as 2008-01-13_Boston.
    Both. See above.
    I'm kind of at a loss as to what down the road is going to be most beneficial when it comes to locating photos or to sorting methods.
    Again, remember that are creating two distinct storage/filing/retrieval systems (files and images). Your file naming convention should be designed to help you locate and identify files outside of Aperture. Inside Aperture you can make extensive use of Folders, Projects, Albums, Keywords, Labels, and Flags to bring you whatever functionality you desire.
    Are underscores necessary between the various components?
    The time when this was useful because some computers couldn't handle spaces in file names is past. I do it out of habit.
    I do mostly travel and nature photography and and have generally keyworded in the past to find my pictures. I've scanned forums, etc., but haven't found any really good advice on this. I'd appreciate any thoughts
    Keyword extensively. Use keywords naturally and personally. Your keywords are for you to help you find your files. (Assuming you are not going to sell Stock Photos.)
    Reading a bit further, maybe a counter is what I need, such as 2008-01-13Boston001, etc. If I understand that correctly, as I import further pictures to that project, they will just continue the counter (002,003,etc).
    I don't think so. The counter, afaik, counts the number of images in the import.
    I only need to remember to reset the counter if I'm going to import into a different project (assuming I don't already have pics in the other project, in which case I would start the counter with the last number in the project + 1).
    Seems complicated and likely to fail due to user error.
    And returning to the date issue - is there a benefit in having the Date fields at the beginning of the file name? If you were searching for dates, wouldn't the search pull from the date info that is already inside the picture file?
    Inside Aperture, there is no advantage whatsoever. Outside Aperture, there is a significant advantage.
    Again, I'm asking for those with some years of experience under their belts, as to their opinions and any downfalls they see with my various schemes.
    I should also mention that I'm thinking about letting Aperture "manage" the files, since I have about 100GB to import and I have a 1TB hard drive. If I run out down the road somewhere (I'll probably be dead before then. , then I'm thinking I can just transfer the library to an external and point to it there.
    Highly recommend a Referenced Masters system from the get-go. Terry Devlin (iirc) has many sensible posts on this here -- search the forum.
    Thanks!
    Mark
    Good Luck!
    Message was edited by: Kirby Krieger

  • File naming with sequence

    My editor requires that I name a file as in the following example:
    FI_RX_London(sequence number)
    if I try this while importing using file name with sequence, there will be a - sign in front of the number. My question, how do I remove the - sign

    In the import dialog, pick Filename-Sequence from the drop down File Naming list. (you will have done this already). Now click the drop-down list again and choose Edit. You will now see the Filename Template Editor window; remove the hyphen from the text box that shows
    {Filename>>}-{Sequence #(1)>>}. When you edit this, you will see the example just above it, reflect the change.

  • PE7: Problem with auto file naming of scanned photos

    I began scanning photos using PE7. PE stored the files in my designated folder. It named the first scan "Image1.jpg." Thereafter, files were named "Image1-nn.jpg." I would finish for the day, and PE would pick up where in left off in file naming for the next batch.
    All was well until I got the bright idea to rename the first photo to "Image1-0.jpg," so it would sort properly. Worse, perhaps, I renamed it outside of PE, in Windows Explorer. Unfortunately, this confused PE completely. Now, it wants to restart the file naming with "Image1.jpg," and scans terminate with a message that the scan was unsuccessful because there is already a file with that name in the catalog.
    How do I go about resetting things back, so that subsequent scans resume at the next available file name+number?
    Second, is there a way to control what prefix ("Image1") gets inserted in scanned file names?
    Thanks.

    By renaming the file outside of PSE, it's now "missing" in your PSE catalog and PSE doesn't know how to find it -- its thumbnail should have a yellow question mark on it.   Do File > Reconnect > All Missing to reconnect any missing files with their new locations, and going forward, only rename and move files in the catalog using PSE.
    Once you've reconnected the missing files, the scanning should no longer be confused about file names.
    I don't think you can control the filenames used by the scanning.  You can set the folder used via Edit > Preferences > Scanning.   For a number of reasons, I do scanning in two steps -- first, I use the scanner's utility to scan to a file, then I drag the file into the Organizer.  This gives me fine control over the file's name and folder location.

  • File Naming for Image Sequence to work properly?

    Hi,
    I shot about a 226 shot time lapse this weekend and so far having a severe pain getting it to be a time lapse movie in photoshop.
    Shots were 3 minutes apart.
    Originally I tried using the RAW images, then exported them to full size jpeg, then finally exported them to HD video resolution jpegs thinking format might be part of my issue. But it seems to be more of a naming convention problem.
    Originally tried :
    AAA-XXX-<4 digit shot #>-20100508.<ext> & AAA-XXX-<4 digit shot #>-20100509.<ext>  as it spanned over night. Once sequence was loaded I then saved as PSD before trying to export.
    That would only load the very first image, even though it would come up with the frame rate question.
    Then I shorted it to 0508-HHMMSS.jpg & 0509-HHMMSS.jpg and set the frame rate to 10 frames per second. It warned "This sequence has gaps". Once sequence was loaded I then saved as PSD before trying to export.
    This created a 36 minute timeline in CS5 but the opening image was the one I selected, and then about 36 minutes of blank, with a random image from somewhere in the middle of the scene being the last frame.
    I tried this in both CS5 and CS4 thinking it may be a bug just in CS5.. but I get the exact same results.
    What naming convention is the Image Sequencing 'open' really looking for to work properly. I would have thought that either of the above would have worked.. but so far they are not.
    Any help would be appreciated.
    Using Adobe Photoshop CS5 & CS4.
    Christopher

    I did just do a generic 1.2.3.4.5.6. export up to 226 and that seems to have worked. But I don't think I should have to do that and the image sequence function should be able to handle more agile file naming sequences.
    Christopher

  • How to add folder/project name to a File Naming preset

    Here's a tip to automatically add the name of the Project or its parent Folder to the filename during Import or Batch Change.
    I always used a custom field for adding my client's name to the filename upon Import or Batch Changing versions or masters. But often I would forget to change the custom name, and since it's auto-populated with the previous entry, I'd end up with a bunch of files with the wrong client's name on them. That looks kind of bad. So once I saw with Aperture 3 you can add the Project name or Folder name when relocating referenced files to the new folder structure, I was excited to be able to do the same for the filenames at import. Well, no such luck. They're not an option when you create a custom File Naming preset.
    However, I recently decided to poke around inside some plist files, and found a workaround. I discovered the format string for Folder Name is %F and Project Name is %P. The trick is getting the code into the Format Field where you create the preset.
    Create a new File Naming preset by choosing "edit" from the Version Name menu during Import or Batch Change. Drag everything you want in the name into the Format field, and enter %F or %P where you want the Folder or Project name. The tricky part is that you can't insert it between two existing criteria. It only works at the very end. After you have it in place, you can drag the criteria around to get it in the order you want.
    The alternative method is to insert the code directly into the plist. PLEASE, always make sure you're working with a copy and have a good backup when you're poking around in such things. If you have trouble getting the code to take from within Aperture, you can try this. Same as above, create a new preset, but this time, enter an F or P where you want the Folder or Project name. Give it a unique preset name and save it. Then Quit Aperture. Navigate to ~/Library/Application Support/Aperture/FileNamingPresets.plist, and make a copy of the file, then open with Property List Editor. Dropdown the plist and then dropdown the item you want to edit. You should recognize it by the preset name. Now the easy part. Click in the FormatString field and insert the % character before the F or P you entered in the Format field. Save and you're done.
    I discovered later that while the Folder and Project name works just fine during import, for some reason only the Project name works during Batch Change. The Folder name simply creates a "-" in the filename.
    In case this is seen as a hack and gets deleted, I'm also submitting it to http://www.macosxhints.com/ and I suspect if anyone from MacCreate sees it, they'll steal it too, as they're known to do.

    I do not think there is an out of the box way to do this.
    The immediate solution that comes to mind is using a workflow, that runs everytime  a document is uploaded/item created, which may be too much for your scenario.
    Cheers,
    Prasanna Adavi, Project MVP
    Blog:
      Podcast:
       Twitter:   
    LinkedIn:
      

  • I had two files named graphics and I replaced one graphics file with another which was the wrong one.  Can I undo my replacement?  I move the wrong one, which was on my desktop into another one and that is when it as me if I wanted to replace the file.

    I accidently replaced a file with another.  Can I undo my action? 
    I had two files named graphics.  One was on my desktop and another was within another file called solitarie.  I move the one on my desktop (wrong file) into the solitarie file and was asked if I wanted to replace the graphics file in the solitarie folder (the correct one).  I said yes accidently and then remembered that I had made a mistake.  If I use undo, it only move the wrong file back to the desktop.  Is there an undo of replace?

    Sorry, but's that's why you get the warning. "Replace" means just that - the new file over-writes the old one. There is no undo.

  • How do I remove an icon or file named EDC7C000 on my screen?

    Have encountered an icon or file named EDC7C000 which showed up on my screen &amp; unable to delete it. Can anyone advise me how to remove it? TY

    Have encountered an icon or file named EDC7C000 which showed up on my screen &amp; unable to delete it. Can anyone advise me how to remove it? TY

  • Unable to copy/cut/paste from within custom file naming dialogue (in exporting images)

    When I go into the export dialogue and select a portion of a file naming scheme,  I cannot get it into the clipboard. I had wanted to cut a portion of the specification, export with an amended name, and then paste the original back. I am running the beta in Win7 64-bit.

    Advice:
    1) Check Copy in sand-boxed app. in 1.6.0_24+.
    2) Do not hi-jack the threads of other people. Start a new thread and if you think another thread relates to your problem, link to it.

  • Custom File Naming

    Is there any way to save a custom file naming routine into a preset?

    Well, for me at least, this is the workflow I would like to see built in:
    1. Load card or point to folder
    2. Images are placed in a sorting place (I use the term "shoot")
    3. Select keepers from the shoot (note a shoot could have hundreds of images)
    4. Right click on a library folder to FILE images to
    5. LR knows the naming convention used in that folder and prompts for confirm/edit
    6. Images are FILED to the library folder via a move and rename using the above info
    This is what I have today and it works well and is fast. The primary benefit I have in LR as-is is the post filing processing. I will say that the keywording is not as robust or fast as I would like.

  • File Naming Problem in Camera Raw 5.4

    Am having a problem when processing Raw images in CS4 using Camera Raw 5.4
    After processing the image I click 'Save Image'.
    In the 'Save Options' box, under 'File Naming' I enter what I want to call the saved image.
    Eg.  'Hooded Top' becomes 'Hooded Top.jpg'
    The file is then saved onto the Desktop.
    Camera Raw seems to be 'stuck' on a previous file name. It will add the same previous file name to the end of the new image.
    You can see in the image that the text to the right of 'Example' also seems to be stuck between two lines of text.
    If I want to call an image 'Hooded Top' it will add an old name
    Eg. 'Hooded Top' will become 'Hooded TopTrack Pants.jpg'     (Track Pants being the previous image name)
    I have been using CS4 trial for a month with no problems. I have just upgraded to CS4 from CS3 today. The program was working fine all morning.
    I have re-installed CS4 and restarted my Mac Pro (OSX 10.5.8). I am using a Canon EOS 5D Mk2.
    Any thoughts appreciated.

    Look in Task Manager.
    One or both of them may be running under Processes.
    Use End Process.
    My advice is not to use the automatic startup for Bridge.

Maybe you are looking for

  • How to use 10 touch points at the same time ?

    I want to project game which use about 10 touch points? How can I use all of them at the same time ? Please give me a sample code.

  • Want to play games from my iPad on tv using apple tv?

    Helle

  • Default stock type QI stock in Purchase order

    Dear Experts        I want set default stock type as Quality inspection stock for QM related materials, while doing MIGO against purchase order.. Means whenever MIGO carried out system should display QI stock   for QM related materials. (Please note

  • License key question

    I will be adding a viewing license key to our PROD server which is for 2 processors.  The sever actually has 4 processors.  Will this cause any problems during installation?  Will BOSE use just 2 processors of the 4?  Or do we need a 4 processor lice

  • Essbase excel add-on error after installing IR Studio.

    Hyperion software compatibility issues? Getting Essbase excel add-on error ("Error 1040007 Cannot find message database") after installing Hyperion Interactive Reporting Studio 9.3.1. We are able to consistently reproduce the error on several worksta