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!

Tags: Illustrator

Similar Questions

  • Removed the custom CSS reappears when export and import

    Apex 4.1.1.00.23
    I created an application and originally imported two custom CSS files. I decided to not use it, so I deleted them shared components. They no longer appear in the shared components section. I export the application and import it into the same workspace (different application id) or in another workspace (on a different database) I and the two CSS files reappear in the shared components. How the hell is - what happens? I can't understand! I have an another CSS that I use, so when I export/import I choose to include shared components.

    I tried searching for files in the images/themes directory and don't see them. They are also not in the WWV_FLOW_CSS_REPOSITORY table at the time that I perform the export, but after importation, they appear as if by magic in the WWV_FLOW_CSS_REPOSITORY table.

    Any suggestions would be greatly appreciated!

    Jennifer

    Hello

    You create the installation script for this CSS file to your application supporting objects and when you install your application, it asks you like install support objects?

    Kind regards
    Jari

    -----
    My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • I bought my computer from someone else. Change user accounts did not name of each file in the computer. How can I change or remove the user/name (my name) /document? __

    I bought my computer from someone else. Change user accounts did not take their name off of each (or more) file in the computer. How can I change or remove the user/name/document
    I have looked everywhere and changed user information and the name of the administrator. What can I do else?

    Hello flashgordonjxn,

    Who has ever done the installation of Windows, the installation program asks you to enter your name and optionally, the name of the organization. These registration information appears under recommended for in the general tab of the System when you click Start, click Control Panel, click performance and Maintenanceand then click System.

    To change see instructions below:

    1. Click Startand then click run.
    2. In the Open box, type regedit, and then click OK.
    3. Look for the following registry key:
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
    4. To change the name of the company, follow these steps:

      In the right pane, double-click RegisteredOrganization. Under value data, type the name that you want, and then click OK.

    5. To change the name of the registered owner, follow these steps:

      In the right pane, double-click RegisteredOwner. Under value data, type the name that you want, and then click OK.

    6. Click Exit on the file menu to exit the registry editor.

    Hope this helps you. Let us know anyway. Make it a great day!

    "And in the end the love you take, is equal to The Love You Make" (The Beatles last song from their latest album, Abbey Road.)

  • I have deleted the content of several image files and now want to remove the file names. I don't find a way to remove the names.

    * Original title: file names of photos of Deletig Windows after emptying the file

    I have deleted the content of several image files and now want to remove the file names. I don't find a way to remove the names. How can I delete the file names?

    Right-click on the name of the image file, then choose 'delete '.

  • What should I do to remove the user name of the saved list when I connect

    What should I do to remove the user name of the saved list when I connect

    I think maybe he's talking about the list that is displayed when you connect to a web mail service. It shows several previous usernames used. How to remove one of them from the list?

  • 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)

  • Removing photos rejected when the catalog is in offline mode will remove the file when the disk is reconnected?

    Hello

    Let's say that I am not connected to my lightroom files and just navigate using the catalog offline.

    Now imagine I reject and delete a photo, lightroom deletes the actual photo in the folder of the next time my photos liebrary is online? (or will it just remove Intelligent forecasting and thumbnail library and keeps the file source intact without my knowledge of its existence?)


    Thank you

    K


    Thank you for your patience and to specify your query.

    As you say, you have created Smart Preview and unplugged the external hard drive.

    Now, if you apply the filter to the rejected images and try to delete the images, you will get the dialog box below.

    As you can see, it is said that it will remove the file only from the Lightroom Catalog.

    As it is impossible to find the source location, you will not be provided with an option to remove the images from the computer or external hard drive (in your case).

    The files will remain as it is on your external hard drive.

    If you want to remove the both original files, I you suggest to connect the hard drive and then choose Remove disk to remove the catalog, as well as an external hard drive.

    I hope this helps.

    ~ UL

  • How to remove the file if is no longer located in...?

    When I try to delete, the file in the download folder can not be deleted. And illustrated: this item is not found.
    "This is no longer in C:\Users\Downloads. Check the location of the item and try again. "Please, help me to remove it.

    Try to use one of the following free products to remove the file/folder.  Unlocker to: http://www.softpedia.com/get/System/System-Miscellaneous/Unlocker.shtml or file Assassin http://www.malwarebytes.org/fileassassin.php (with or without forcing the deletion and I would try with: http://www.mydigitallife.info/2008/12/27/force-delete-cannot-delete-locked-or-in-used-files-or-folders-with-fileassassin/). These programs often work when normal functions remove Vista not work correctly.

    If this does not work, try to boot in safe mode (repeatedly clicking the F8 key during startup until the menu appears) and see if you can remove the file from there.  If necessary, try the two programs above Safe Mode again.

    I hope this helps.  If this isn't the case, please post back and provide us with the EXACT message Word for Word text.  What type of file is (which is its extension - the name of three digits after the point in the name of the file)?  What is the size of this file (how many bytes or MB or GB)?

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How can I remove the user name and the image of Windows XP new Start Menu

    Two questions:

    1. How can I delete the user name and the image of Windows XP new start; and

    2. my computer keeps asking me to press the F1 key to start Windows.  How to skip this part?

    Thank you.

    Hello

    The image of user account can be removed by disabling the Welcome screen. Or, by opting for the classic Windows theme. Follow the method described in this article, if you want to remove the user name and the picture in the Start Menu, without disabling the Welcome screen and Windows XP theme.

    For those who want to delete the user name and the image of user account from the Start Menu, in order to have a blue white Panel at the top, try this:

    Registry warning
    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    How to back up and restore the registry in Windows
    http://support.Microsoft.com/kb/322756/

    Step 1:

    a. start Windows Explorer and go to this folder:
     
    C:\Documents and Settings\All Users\Application Data\Microsoft account images

    b. in this folder, rename the BMP file that corresponds to your user account.
     
    (For example, if your user name is Robert, rename Robert.bmp to old_Robert.bmp)

    c. then rename the following folder:

    C:\Documents and Settings\All Users\Application Data\Microsoft account Pictures\Default pictures
     
    to something else, for example,.
     
    C:\Documents and Settings\All Users\Application Data\Microsoft account Pictures\No_Default images.

    Step 2:
     
    To remove the user name, follow these steps

    a. Click Start, click "RUN" and type "regedit.exe" and navigate to this key:
     
    HKEY_CURRENT_USER-Software-Windows Microsoft\------CurrentVersion-policies-Explorer

    b. in the right pane, the value NoUserNameInStartMenu-value data 1.

    c. close Regedit.exe and restart Windows.

    You'll find yourself with a blue area at the top of the Start Menu.

    Regarding the pressing 'F1' to start Windows, you have made no changes or was there a system crash after which the problem started?

    You may need to change the boot sequence in the BIOS to the default settings. I recommend you contact your PC vendor for this.

    Warning of the BIOS:
    BIOS change / semiconductor (CMOS) to complementary metal oxide settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk.

  • Are there any newspaper to remove the file or folder in windows xp?

    HII,
    Is there any newspaper to remove the file or folder to replace in laptopwith windows want to see when it is removed or replaced.or as I want to go where it is removed? And which user delete it.for e.g. If some a delete directly from network so where I can see my PC or help network me p.c.Please I want to find which delete some important files?

    Hi Julie Theiler,.
     
    Unfortunately there is no such feature which keeps track of the information of deleted files. However, you can check the trash on the network to see if the deleted file's still in there.
     
    For more information about restoring files in the Recycle Bin, see:
  • Can I remove the file 'SaveData.mig' after I run Windows Easy Transfer?

    Can I remove the file 'SaveData.mig' after I run Windows Easy Transfer?

    I used easy transfer to move files from an old computer to my new about 12 months ago. The SaveData.mig file takes 22 GB of space on the new computer. I would like to remove it but I don't know if it will mess up all my files that have been transferred to my new computer. Anyone know if I can delete this file in order to free up space? Thank you

    I agree with Mohdrafi - you can remove safely; However, you should have a more recent backup of your current files just to be on the right side (image FULL weekly backup and an incremental backup every day for an external HARD drive - I've seen too many people get burned when their drive hard breaks down or something worse and then they lose all their precious documents (, photos, audio and other files).  There ARE recovery procedures, but they don't always work, and they don't always get everything (especially if you expect to solve the problem or continue to use the PC in the meantime)- and depending on your version of Vista.  Delete this file will NOT affect the files and settings that you restored using the process.  Could have deleted it hours after that the process has been done (once you have a good backup) and it would have been very well then.  If you have a good backup, I can see no reason whatsoever to keep the file.

    If the normal delete function in Vista doesn't work, try using one of the following free products to remove the file.  Unlocker to: http://www.softpedia.com/get/System/System-Miscellaneous/Unlocker.shtml or file Assassin http://www.malwarebytes.org/fileassassin.php (with or without forcing the deletion: http://www.mydigitallife.info/2008/12/27/force-delete-cannot-delete-locked-or-in-used-files-or-folders-with-fileassassin/). These programs often work when normal functions remove Vista not work correctly.

    Congratulations to the use of Easy Transfer - this is a pretty cool tool isn't it?  Not sure how many threads that we have here people with issues or recoving given him--I saw a lot.  It seems easy on the surface, but when it doesn't work it can become quite complex and aggravating (and I know people who have unfortunately never were able to retrieve their data and settings no matter what we tried).

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • What are the risks by removing the previous Windows installations when you perform disk cleanup?

    What are the risks by removing the previous Windows installations when you perform disk cleanup? Will be some things about windows 7 stop working or be affected?

    The Windows.old folder is your ticket to uninstall Windows 7 and roll back to Vista.

    If you are happy with the results of leveling, can access all your data files, all that you have transferred to the E-mail, the .old folder can be deleted.

    JS
    http://www.PAGESTART.com
    Never be afraid to ask. This forum has some of the best people in the world to help.

  • How to remove the file copy unfinished "MyAccount" W2K3 VM or host Win7?


    People,

    Hello. I use VM Player 3. The OS is Windows 7 and VM is Windows Server 2003.

    I copy a 22GB file "MyAccount" of VM-W2K3 to Host Win7 because hard disk in Win 7 host have 25 GB. In the copy of the file, a message appears as below:

    "It takes extra 22GB copy your file.

    I click the button CANCEL. But the file has not disappeared. The copy of the incomplete file is still in the machine virtual and busy 22 GB of disk space in W2K3 VM or host wind 7.

    My question is:

    How to remove the file copy unfinished "MyAccount" W2K3 VM or host Win7?

    Thank you.

    People,

    Hello. I found the 22GB "myfoder" file in the directory VMwarDnD on Windows 7 computer host computer. When copy us files from VM to the host, they go to this directory first and then go to the desktop. I deleted a lot of files in this directory to get the amount of disk space.

    The problem is resolved. Thank you.

  • How to remove the file from the client machine

    Hi all
    We use the database: oracle: 10 g,.
    and forms/States 10g (developer suite 10g - 10.1.2.2).

    can someone help me how to remove the file from the client computer in the location specified using webutil or everything
    (I tried with webutil_host & client_host but this only works for the application server)
    Thank you.

    Hello

    Checkbox not tested.

    PROCEDURE OPEN_FILE (V_ID_DOC IN VARCHAR2)
    IS
    
    --------------------------------------------------------------------------------
    -- Open a stored document --
    
    --------------------------------------------------------------------------------
    LC$Cmd Varchar2(1280) ;
    LC$Nom Varchar2(1000) ;
    LC$Fic Varchar2(1280);
    LC$Path Varchar2(1280);
    LC$Sep Varchar2(1) ;
    LN$But Pls_Integer ;
    LB$Ok Boolean ;
    -- Current Process ID --
    ret WEBUTIL_HOST.PROCESS_ID ;
    V_FICHERO VARCHAR2(500);
    COMILLA VARCHAR2(4) := '''';
    BOTON NUMBER;
    MODO VARCHAR2(50);
    URL VARCHAR2(500);
    
    Begin
    
    V_FICHERO := V_ID_DOC;
    
    LC$Sep := '\';--WEBUTIL_FILE.Get_File_Separator ; -- 10g
    LC$Nom := V_FICHERO;--Substr( V_FICHERO, instr( V_FICHERO, LC$Sep, -1 ) + 1, 100 ) ;
    --LC$Path := CLIENT_WIN_API_ENVIRONMENT.Get_Temp_Directory ;
    LC$Path := 'C:';
    LC$Fic := LC$Path || LC$Sep || LC$Nom ;
    
    If Not webutil_file_transfer.DB_To_Client
    (
    LC$Fic,
    'TABLE_NAME',
    'ITEM_NAME',
    'WHERE'
    ) Then
    
    Raise Form_trigger_Failure ;
    
    End if ;
    
    LC$Cmd := 'cmd /c start "" /MAX /WAIT "' || LC$Fic || '"' ;
    Ret := WEBUTIL_HOST.blocking( LC$Cmd ) ;
    LN$But := WEBUTIL_HOST.Get_return_Code( Ret ) ;
    If LN$But 0 Then
    Set_Alert_Property( 'ALER_STOP_1', TITLE, 'Host() command' ) ;
    Set_Alert_Property( 'ALER_STOP_1', ALERT_MESSAGE_TEXT, 'Host() command error : ' || To_Char( LN$But ) ) ;
    LN$But := Show_Alert( 'ALER_STOP_1' ) ;
    LB$Ok := WEBUTIL_FILE.DELETE_FILE( LC$Fic ) ;
    Raise Form_Trigger_Failure ;
    End if ;
    
    If Not webutil_file_transfer.Client_To_DB
    (
    LC$Fic,
    'TABLE_NAME',
    'ITEM_NAME',
    'WHERE'
    ) Then
    NULL;
    Else
    Commit ;
    End if ;
    LB$Ok := WEBUTIL_FILE.DELETE_FILE( LC$Fic ) ;
    
    Exception
    When Form_Trigger_Failure Then
    Raise ;
    End ;
    

    Sarah

  • How can I remove the file from the adware N10.adshostnet?

    How can I remove the file from the adware N10.adshostnet?

    How can I remove the file from the adware N10.adshostnet?

    Run adwcleaner.

    http://www.bleepingcomputer.com/download/adwcleaner/

Maybe you are looking for

  • Is it possible to bookmark all tabs in a folder at a time?

    I love the previous session 'restore' in history, but 1) sometimes I forget until I've already opened a new session. and (2) sometimes I have a couple of value of the windows of the tabs on different subjects. It would be good to have a command to bo

  • Update the BIOS HP Pavilion p6-2071scm

    Cannot locate the BIOS updates, or updates driver from HP site - is not that I do not receive my updates of pilot also. BIOS update is my last hopeful Act prior to disposing of this motherboard, since the old BIOS does not support my new graphics car

  • Satellite U500-1DV - recovery disk does not work

    Satellite U500-1DVWhen windows starts up the first time, and while Toshiba request is things installation and system configuration, Windows crashes and restarts the system.What can I do? It happens every time. Thank you

  • HP Pavilion 502 to slow down.

    Hello world I have a HP Pavilion 502 and it's slow. Memory has been upgraded to at least 256 MB and everything works it is MS Office, software, Verizon, Firefox, HP all-in-one, KMP Player, Teamviewer, iTunes and just removed the old anti-virus progra

  • How can I fix search for windows vista sp2

    original title: repair of search for windows vista sp2 I don't have a problem with my Microsoft updates, but stopped my search on the functions of my office functions. I have Window Vista Home Premium 32-bit with Service Pack 2 installed. How can I f