First characters of the file name to create a folder name

Hello

I need to use the first characters in a file name given to underscore image to create a folder name in which the image will be so recorded.

I already use the slice method to fly out of the file extension and some other stuff but seeing that the image names and the code initially aren't all the same length I need another method allowing to identify underscore.

var ChronoFolderName = app.activeDocument.name.insert_magic_method_here;

Any ideas?

Thanks in advance

Neil

Use the distribution. This will create a table filename parts which are separated by the underscore character. If you have several traits underscore, you can loop together to get the desired length. I normally just a division that separates the the frame number job number, so I just put [0] after the separation and it captures all the information to the first line of underscore.

var newName = doc.name.split('_');

Tags: Photoshop

Similar Questions

  • Given the file name or path contains Unicode or DBCS characters. Retry using ASCII characters for the file name and path whatever that means? This happens when I publish an OAM

    Given the file name or path contains Unicode or DBCS characters. Retry using ASCII characters for the file name and path

    What does that mean? It happens when I try to publish an OAM for Dreamweaver.

    Also: How can I specify the onboard browser animate? It's just going as far. Are there no preference to animate it dashboard?

    BTW. Just call him edge. Seriously. You call Illustrator draw? Photoshop editing?

    No, my file name is mainContent.oam

    My project name is mainContent.an

    This error occurs when I try to import into Dreamweaver. Sorry, I was unclear about that earlier.

    I thought maybe it was because I had saved my image as a png image. So re-saved as an svg, still get the error.

    Should I have a setting is CC of Dreamweaver that will not? I should try this in Dreamweaver CS6? I might try that next.

    Why is this so difficult program? I know that Flash. I know that After Effects. I can work the chronology part simply awesome. He's still export I have problems.

    On a MacPro, 10.7.

    You are a person of Adobe or simply a beautiful assistance program?

  • Cannot read Document in FileUtilities to search a file with french characters in the file name

    Hello

    I'm looking for a file with french characters in the filename as"ecran.doc" in my unix Server directory and write the file somewhere, say, in a list of documents, or write to files to another directory.

    I use to read Document in FileUtilities of the Foundation, but it cannot read the file due to the french character in its name. Although it can find another name of file without these french characters.

    I tried to rename but who also can not find the file with the name of the french character.

    Please provide any idea to solve using LC operation.

    Kind regards

    Raj of Rohan.

    Hi Thomas,

    Thanks for the post, but I already found a solution to this a month ago. Sorry for not posting the solution.

    Just put the '-Djava.property.file.encoding = ISO8859-1' in your server startup JVM argument and position the rebound on the back of the server to choose the new JVM arg . And now the reading service of Document in FileUtilities of the Foundation read characters all french.

    ISO8859-1refers 'no. 1 Latin alphabet,"consisting of 191 characters from the Latin alphabet. This character encoding scheme is used throughout the Americas, Western Europe, Oceania, and much of Africa. It is also commonly used in most of the Etymologies of the East Asian languages.

    Kind regards

    Raj of Rohan.

  • How to find and remove special characters in the file name?

    I have a files in various Windows Server 2003 with a special character in its name, which cause problem with backup software, I Don t know which character is because in the browser that they do not appear and command line, they are listed only as a mark of the interrogation and for this, I Don t know how I'll find and delete then.

    Thank you.

    Ask in the forum Windows Server:
    http://social.technet.Microsoft.com/forums/en-us/category/WindowsServer

  • How can I change a SINGLE CHARACTER in the file name?

    I have in the Panel right side meta tag a file name, the original name and copy name field.

    The file has been renamed already. So I'm not interested in original file name, in any case I can't click on it.

    "I would like to change a +! / « % / « + ! CHARACTERS in the file name field which is 50 characters.

    If I click on it gives me a window of batch renaming.

    If I click on the name of the copy that I have to write everything from scratch BECAUSE I can NOT COPY the file name field.

    So here we are in the 21st century

    I have a solution: I copy the name of the file from the vista Explorer and paste into copy name BUT what if I do this hundreds times?

    First of all, bringing the name of copy to do with the file name? I think you are badly understand the purpose of the copy name field. It's to give a virtual copy a distinctive name.

    Now for the naming of the files is... If I understand, you want to change the name right in the metadata Panel, but the file name field is not editable. It is a bug. It is exposed when you have multiple selected files and change the display of the metadata Panel. You can fix it temporarily by selecting a single file in the grid and change the display of the metadata Panel of any defect or vice versa (see the attached screenshot). Now that the field become editable, you change the character.

    If you want to for hundreds of files by using a template, then would be nice if you provide your source and target file name patterns.

  • Remove the file name characters when exporting to file

    Hi all

    I worked with Silly-V , which has been extremely useful in creating a script to automate creating files in Illustrator.

    What I need help with now is the ability to add in this script, the ability to remove "x #" character of a filename on export. This would be ideal, as it will completely automate what I did by hand for months.

    The current script, that we have put in place takes generally, which would take me about 1 minute per file and it has reduced to 10 seconds. Translate this in the whole of the need to treat roughly 800-1 000 files, and you can see where the time invested is decreased significantly.

    The last piece of the puzzle is the removal of characters from ONE of the two files that are created through this script.

    First of all, this is the current script. It seems to work perfectly for what I ask it to do.

    #target illustrator-19  
    function test(){  
      
      
      var folder_1 = Folder("~/Desktop/Header CAD");  
      var folder_2 = Folder("~/Desktop/Clean CAD");  
        
      app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;  
        
      function revealAllLayers(doc) {    
          for (var i = doc.layers.length - 1; i >= 0; i--) {    
              doc.layers[i].visible = true;    
          }    
      };    
      
      
      
      
      function hideLayer(doc, name) {    
          doc.layers.getByName(name).visible = false;    
      };    
      
      
      
      
      function exportMyPng(dest, doc, props) {    
          if(props.hasOwnProperty("antiAliasing")){    
            switch(props.antiAliasing){    
              case "ARTOPTIMIZED" : {    
                  app.preferences.setIntegerPreference("plugin/PNGFileFormat/AntiAlias", 1);    
                  break;      
              }    
              default : {    
                  break;    
              }    
            }    
          }    
          var pngOpts = new ImageCaptureOptions();   
          pngOpts.antiAliasing = true;   
          for (var all in props) {    
              if (pngOpts.hasOwnProperty(all) && all != "antiAliasing") {    
                  pngOpts[all] = props[all];    
              }    
          }    
          doc.imageCapture(File(dest + "/" + doc.name.replace(/\.\w+$/, props.extraStuff + ".png")), doc.visibleBounds, pngOpts);    
      };    
      
      
      
      
      var doc = app.activeDocument;    
      revealAllLayers(doc);    
      hideLayer(doc, "Materials");    
      hideLayer(doc, "Detail Artwork");    
      exportMyPng(folder_1, doc, {    
          transparency: false,    
          antiAliasing: "ARTOPTIMIZED",    
          resolution: 300,    
          extraStuff: "_header"
      });    
      
      
    
    
        
      hideLayer(doc, "Header");    
      exportMyPng(folder_2, doc, {    
          transparency: false,    
          antiAliasing: "ARTOPTIMIZED",    
          resolution: 300,    
          extraStuff: ""
      });    
      
      
      app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);  
      
      
    };       
    test(); 
    
    test(); 
    

    I found the program Name Mangler done an exceptional job of the completion of the task of renaming. Here's a screenshot of what I'm asking for looks like with this program.

    Screen Shot 2016-08-01 at 3.18.45 PM.png

    My ultimate goal is to be able to integrate this unique Name Mangler feature the existing script I posted above. Now, the problem is that I need ONLY to assign the file created by the section of the lines 66-71. As you can see, I need to remove the file name starting at the index of 14 characters.

    Is it possible and something that anyone can help with?

    Thank you in advance!

    Brooks

    Whew busy days!

    Well, I got this here:

    #target illustrator
    function test(){   
    
      var folder_1 = Folder("~/Desktop/Header CAD");
      var folder_2 = Folder("~/Desktop/Clean CAD");   
    
      app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;   
    
      function revealAllLayers(doc) {
          for (var i = doc.layers.length - 1; i >= 0; i--) {
              doc.layers[i].visible = true;
          }
      };     
    
      function hideLayer(doc, name) {
          doc.layers.getByName(name).visible = false;
      };     
    
      function exportMyPng(dest, doc, props) {
          if(props.hasOwnProperty("antiAliasing")){
            switch(props.antiAliasing){
              case "ARTOPTIMIZED" : {
                  app.preferences.setIntegerPreference("plugin/PNGFileFormat/AntiAlias", 1);
                  break;
              }
              default : {
                  break;
              }
            }
          }
          var pngOpts = new ImageCaptureOptions();
          pngOpts.antiAliasing = true;
          for (var all in props) {
              if (pngOpts.hasOwnProperty(all) && all != "antiAliasing") {
                  pngOpts[all] = props[all];
              }
          }
          doc.imageCapture(File(dest + "/" + doc.name.replace(/\.\w+$/, props.extraStuff + ".png").substr(props.charsOffStart)), doc.visibleBounds, pngOpts);
      };     
    
      var doc = app.activeDocument;
      revealAllLayers(doc);
      hideLayer(doc, "Materials");
      hideLayer(doc, "Detail Artwork");
      exportMyPng(folder_1, doc, {
          transparency: false,
          antiAliasing: "ARTOPTIMIZED",
          resolution: 300,
          extraStuff: "_header",
          charsOffStart: 0
      });     
    
      hideLayer(doc, "Header");
      exportMyPng(folder_2, doc, {
          transparency: false,
          antiAliasing: "ARTOPTIMIZED",
          resolution: 300,
          extraStuff: "",
          charsOffStart: 14
      });
      app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);   
    
    };
    test();
    

    This one has a new parameter "charsOffStart" that you have to stick in your two-functions for the economy, and it will be lop however much from character now!

  • Creative Cloud Lightroom import records show that year and not the name of the file that I created

    When I import files from an SD card to Lightroom, I import to an external drive as my file.  Indicates the name of the folder to the year (2015) and not the name of the file that I created (Fort Worth, 12152015).  This has happened with every import that I've done so far.  How can I fix it?

    The copy option is used to copy the files from your camera card. The Add option is used when the files are already on your hard drive. They must be copied, just added to the Lightroom Catalog. You can simply add the files that are located on a map of the camera. They must be copied to the hard drive first.

  • I want to change the file name format "save under" so the date and time are first.

    When I select a few emails and then select "Save as" to keep a copy on my computer, the name of the file that is created has the date and time at the end of the file name of the email.
    Sample "save under" file name: "Habitat Follow Up - Bryan ([email protected]) - 2011-11-15 0744.eml.
    Is it possible to change the structure or format of the file name if the date and time of the email are initially the file name?

    Try ImportExportTools and customize the format of the file name in the options.

    http://chrisramsden.vfast.co.UK/3_How_to_install_Add-ons_in_Thunderbird.html

  • How can I remove the first 3 characters of the files?

    I'm using the bridge for a while and rename the lot

    How can I rename to remove the first 3 characters of the files?

    (these are numbers)

  • I can't stop slide show of Photos showing the file name at the beginning?

    I made a slideshow for a crowdfunding charity event, but the Organizer is hampered by the fact that the file name displayed in large characters, hiding part of the actual text, when the slideshow begins to play. I can't find anything in the controls or insufficient preferences to stop what is happening, someone at - it ideas? I admit it is a bit ridiculous.

    Thank you!

    Kit.

    Using Photos or iPhoto to run your slide show?  Only the project title appears automatically on the first slide and does not display the names of files.  The user needs to add additional text/filename to each slide with Photosl

    If you use iPhoto then click the gear pinion and check the Show Legend checkbox is unchecked in the slideshow settings window:

  • Titles or subtitles of the file name?

    Is it possible to automatically generate the titles or subtitles of the file name? I have a video made up of several small files and you need to insert their names under the name of a chapter, or at least as a subtitle. FCPX only supports to support the generation of TC.

    The short answer (obtuse) is not. Not in FCPX alone.

    I seriously doubt you will be interested in this procedure, but someone might be.

    You need movement (this is the only expense here), TextWrangler and a droplet of Automator (see below).

    First, gather all your files of clips in a folder.

    Drop the file on the files in the folder (the automator app/drop) that will create a text file with the names of all files in the folder. When you are prompted to save the file, you can name it and save it wherever you want.

    Gout Gets the names of files from the Finder, and they are complete paths, such as:

    / Users/fx/Desktop/txtLicenses/Aardvark Cafe readme.txt

    [You can download a copy of the 'Files in the folder' drop HERE ]

    Open a window in TextWrangler, and then drag the text file to a blank page (very cool - TextWrangler automatically opens the file with drag and drop.) [TextWrangler is FREE of Barebones.com (http://www.barebones.com/products/textwrangler/) software, everyone should have a copy! The most recent version is 5.0.2 in date 25/12/2015]

    Type the command + F to open the Find/Replace dialog box. Make sure that Grep is checked.

    To find them, use this regex:

    .*\/(.+)\.. +

    [translated: find everything up to and including the last ' / ' character, can find everything up to the last period and save it as a game (the parenthesis) and then find everything at the end of the line]

    As an alternative, use:

    \1\n

    [Translated: prints the substring and adds a newline character - it will be double space lines of text]

    In the drop-down menu with the label of 'g', save... (model - something like Remove Path and FileType) so you can find it again easily.

    The text from the above example will become:

    Aardvark Cafe readme

    [and will follow an empty line]

    [I recommend you do all your spelling at this point.] Make sure that all text is as you want it to appear in FCPX. Repair later gets a bit dicey. and generally it is a good idea to start over if you need to make changes to the text file.]

    Save the file with another file in TXT format.

    On the move:

    Create a project generator. It can be almost any length, so accept the default value of 10 seconds. You will be stretching out in FCPX in any case.

    Add: Generators > text > file

    [You can use the Inspector to Format to choose the font, size, etc. and the inspector looks for color and 3D options].

    In the Inspector of the generator, find the section, load your text file

    Set the speed to Custom

    Reset the Custom speed setting

    Publish the speed of Custom setting slider

    Save in FCPX (and create a category called subtitles)

    When you save the generator in FCPX, the file being used is hard-copied in the media for access folder. You cannot publish the setting browse generator, so all files subtitles prepared in this way are projects of "One Shot". You can throw away them once your project is completed because their utility essentially died with the FCPX project.

    In FCPX, apply the generator to the plot and develop it to adapt to the length.

    Keyframe of the lines of text to match the timing of your video. This is where double spacing will be useful because it is a real pain in simple lines of keyframe and you will need a bit of space for a step-by-step. You can, of course, import the audio portion of your story in motion, create a project for quite a long time for the entire length and key image subtitles in movement. You can export as, eventually, the subtitle project as ProRes (if you do not use 4444, then you can apply the Composite blend mode add to the layer that you use in FCPX as the background should be black.)

    If all of your clips are the same length of time, then using the subtitle generator is a snap. Set a keyframe at 0 for the appearance of the first line and in the end, the last line should appear, simply drag the speed until the last line shows control (should be at or close to 100%). The generator systematically displays a single line both throughout the progression of his 'read'

    I found that the faster is to import the audio in motion and create a Motion project, the length of the audio used for subtitles + a little extra at the end.  Listen to the audio, and for each line that you display, add a keyframe... little whatever it is. When there is a keyframe for each line, listen again and adjust keyframe values to display the line. This will leave you with linear transitions from one image to another key (and overlapping in some cases, or the appearance of lines before image real key because of "Rounding errors") - is NOT a problem! Just select 1 keyframe, type command + A to select all the keyframes, and then right-click on a keyframe and select constant on the menu drop down. This will create a step-by-step through each value and you give the * discreet * timing you have need for the text to appear at the right time.  Remove the audio track and save the project as a generator of FCPX... it is faster and easier to export a track video overlay.

    You need movement 5.1.x or better (there are serious problems with 5.0 versions and file generator.)

    I know it doesn't look like it, but this method of captioning is much easier than ANY other software of captioning I've tried in the past... NO timecode or the special formatting is required... other recommended spacing to double.

    HTH

  • How watermark with the file name?

    I've searched and searched and I can't find an easy way to do this... but it MUST be possible!

    Some (really clumsy) Solutions, I found:

    1. I can create a .csv with two columns, each list of filename for each image in a folder.  Then, using variables in PS, I use the first column as a variable image replacement and the 2nd column as a text replacement variable to export the files.  This solution is both your time and creates images that are all the same size.
    2. LR/Mogrify plugin 2 - what might do the trick, but it doesn't seem to work with the latest version of LR
      • (I get this error: an internal error occurred: LRCatalog; withCatalogDo has been marked obsolete in Lightroom 2.0 and is not supported from Lightroom 3.0) This call is necessary.)
    3. Somehow use a droplet, pulling on the name of the metadata file to generate a watermark text... which I can't figure out how to do.

    How can this be complicated?  There must be a clear Super button, Miss me him somewhere in LR, because I can't imagine NOT having need of this feature.

    Help, please!

    You can do it in the slideshow module. By clicking on the ABC button on the toolbar and choosing the file name in the menu dropdown. You can drag the text box anywhere to anchor it in the Center, downstairs, etc. top of page. You can print a whole batch to PDF. See image:

  • How can I change the unrecognizable FrameMaker file format?  Why has he become unrecognizable after changing the file name?

    I update an existing project in the FrameMaker10, which is located in a structure of book.  I changed the names of the files in the directory, they upgrade 11 FrameMaker and saved.  When I try to add them to the book (whose name I also updated) a problem for some files. When I try t add them to the book file, I get an error message that says that the book file is unrecognizable.  (It allows me to add it, but it appears in the file book with an icon that has a blue "M" in there.)  Why is that happening and how can I change these files to normal FrameMaker files?  Thank you.

    Try to open the problem files using a text editor or viewer of files to see what the first bytes contain. Contains all the binary files valid FM FM 11 in the first bytes of the file.

    During the updating of the books, it is sometimes better just to create a new address book file and add files to it.

    When you rename files in a book, changes at the level of the system will break any links/cross-references between files, so it is always best to use the option rename book in the file to change the names of files FM. This will keep the correct links.

  • Limit the length of the file name of the file to download in a file.

    Hello

    I got a file navigation item. When the file name is 74 more characters, he goes to an error page. Can this be avoided?
    To avoid this, I tried to use a javascript script
    function doSubmitWithProgress()
    {
    If {(document.getElementById('P202_FILE_INPUT').value.length > 70)
    Alert ("file name must be less than 70 characters.'");
    Object.Focus ();
    }
    on the other
    {$x_Hide ('wwvFlowForm');
    $x_Show ('InProgress');
    doSubmit ('UPLOAD_FILE');
    }
    }
    But consider the path of the file as well and therefore to cause a problem.
    So could you please help me with this problem.
    If there is a way to avoid going to the error page if the name of the file is big, that would be great. Otherwise, if there is a way to check that the length of the file name and trigger an alert if it is larger than 70 characters, that would help me also.

    Thank you
    Vignesh

    Vignesh,

    You can use the javascript str.split ()* method to break down the full path in a table of its individual parts and then check the length of the last piece (which ends up being the name of the file).

    For example.

    function doSubmitWithProgress()
    {
      // Create a variable to hold the full file name with path
      var fullFileName = document.getElementById('P202_FILE_INPUT').value;
    
      // Now create an array that contains the individual pieces of
      // the file name split on the "/" boundaries
      var myArray  = fileName.split('/');
    
      // The last variable contains the length of the last item in the array
      // which ends up to be our actual file name.
      //
      // NOTE: We have to use myArray.length-1 because JavaScript
      // Arrays start at 0
      var fileNameLength = myArray[myArray.length-1].length;
    
      if (fileNameLength > 70)
      {
        alert('File name should be less than 70 characters in length.');
        object.focus();
      }
    else
      {
        $x_Hide('wwvFlowForm');
        $x_Show('InProgress');
        doSubmit('UPLOAD_FILE');
      }
    }
    

    Hope this helps

    Doug Gault
    [SUMNEVA.COM | http://www.sumneva.com/]

  • where to save the files under options the file name is duplicated how to remove an additional folder with the same name

    Under Options in Firefox, I clicked on save the files under downloads, but the file name twice and an additional file with the same name is created in the folder, i.e.:

    G:\Akbar's Songs\HAMARA DOWNLOADS\HAMARA FORUMS DOWNLOADS FORUMS

    As you can see the file repeats, how can I fix it?

    Also the music files, I download from a site of downloads as a WinRar file and I need to open it. Y at - it an option where the file opens automatically in the folder I chose?

    Thanks a lot for your help.

    Hi Akush, when you install 7 - zip, make itself the default application to open .zip and .rar files. So if you double click on the .rar file, it should open in 7 - zip. If you prefer to decompress immediately, right click the file and look for new 7 - zip items in the menu. I can't think of a way to do this automatically, however.

Maybe you are looking for