Remove [convert] in filename (VBscript)

Hello,
I rewrote a JS code in VB. Everthing works fine except the red lines.
I open an eps-file, the script resaves the file as AI (remove the [converted]) and place the file in the same directory as the original eps-file.
A single file with a correct path (eg c:\test.eps -> c:\test.ai) works fine.
Set appRef = CreateObject("Illustrator.Application")
'new inserted
var doc=appRef.ActiveDocument
var destFile = appRef.Documents.add(decodeURI(doc.fullName).replace(/(?: \[Converted\])?\.eps$/, '.ai'))   'also remove "[Converted]" from filename
Set saveOptions = CreateObject("Illustrator.IllustratorSaveOptions")
saveOptions.Compatibility = 15 'Illustrator CS5
saveOptions.EmbedICCProfile=true 'embed ICCprofile
saveOptions.Compressed=true
saveOptions.PDFCompatible=true 'pdf output
appRef.Documents(1).SaveAs (destFile), saveOptions
appRef.Documents(1).Close 2
Set appRef = Nothing
I hope someone can help me

Great about the calling procedure for "saving"!
1 problem: the doscript doesn't work.
I created an action: test in default actions, I runned the vbs-script by File>script>other script>open the vbs-script and then I get an error:
"The do script command cannot be executed from the scripts menu"
I read in the reference guide:
Plays an action from the Actions palette.
Note:
Use DoScript only if you intend to run your script from an application external to Illustrator, such as the Windows® Script Host.
Calling DoScript when running a script from Illustrator’s File > Scripts menu may yield unexpected results.
Other suggestions to solve this problem?

Similar Messages

  • Import and convert MPG using vbscript

    Hi,
    Does anybody know can I import a video file and convert the footage to iPod compatible format using vbscript?
    Can I use the following script to import a mpg file?
    Set iTunesApp = WScript.CreateObject("iTunes.Application")
    Set mainLibrary = iTunesApp.LibraryPlaylist
    mainLibrary.AddFile("Filename")
    Thanks
    Intel   Windows XP Pro  

    I found a COM function convertfile, but it doesn't work with mpg files. Does the current version of COM SDK 6.0.2.23 support conversion of mpg?
    Set iTunesApp = WScript.CreateObject("iTunes.Application")
    Status = iTunesApp.ConvertFile("m:\test.mpg")
    Thanks in advance.
    Intel   Windows XP Pro  

  • Remove the mouseover filename from a PDF document

    I'm trying to generate a PDF using Adobe Acrobat X Pro through the Word 2007 interface.  When I generate my PDF and mouseover an image, the mouseover text displays the filename of the image file (ie mouseover text="ImageFilename.png").  Additionally, some of these aren't even correct (the image filename is actually a previous revision of the image file and not the current file).  I would like to know:
    -What data does Acrobat poll to get these filenames.  I know it isn't the actual filename since some are incorrect, so it must be some data contained in the word document itself?
    -How can I remove this function altogether?  There is no significance to the image filenames and I'd rather not have to ensure they all match the document text.
    I have searched this and other forums but can't find instructions on how to do this. Any help would be greatly appreciated.
    Thanks!

    function(){return A.apply(null,[this].concat($A(arguments)))}
    Scribby182 wrote:
    -How can I remove this function altogether?  There is no significance to the image filenames and I'd rather not have to ensure they all match the document text.
    I'm not aware of anyway to automatically remove them from the pdf file. You can manually remove each of them but it's always better to treat the source file than to treat the PDF file for changes.
    To keep from seeing them without having to remove them all in Word, just use the "print method" to create the PDF file. Print to the Adobe PDF printer rather than using the Save as Adobe PDF feature.
    Regards,
    Joe

  • Removing spaces in filenames but keeping them at the top of the page

    I would like to change the filenames to remove the spaces, but I would like the top of the webpage that includes the links to the other pages to maintain the spaces. I know I can do this by hand, but that is cumbersome- is there a way to automatically do this in iWeb? Or are the link descriptions always tied to the filenames?
    Thanks,
    Sarah
    1.83 GHz MacBook Pro   Mac OS X (10.4.4)   3.2GHz Pentium 4 Suse and 4GB iPod mini

    Sarah
    I use MassReplaceIt to amend the names at the top of the page, see the Home Page of www.willg4pb.com. In iWeb the page is called Home, but what you see in the header is Welcome to www.willg4pb.com.
    I simply find <title>Home</title> and replace with <title>Welcome to www.willg4pb.com</title>
    There is an example of using MassReplaceIt on the How2 page of www.willg4pb.com, showing how to insert favicon text.
    You can set up multiple searches in one query and save the query, I think its a great app, its donation-ware, so please do support the developer (I have no association with the app, I just think that its really useful ).
    You need to run the query each time you make a change that effects the html file, so dont forget to save your query for use later.
    Will

  • Remove portion of filename

    Hi,
    I am trying to rename some files, or to be precise remove part of the filename instead. The part of the filename I wan't to remove is different from file to file. The files have two segments, the first part is a set of letters that I wan't to take a way. The second portion of the filename is a sequence number, which I would like to keep. The tools I have found so far, will only add to the new filename, or you have to change the whole filename.
    Not sure if I asked a clear question but I hope someone still understand what I am looking for.
    All help will be appreciated
    Best Regards
    Ketil V.

    note:
    Snow leopard's script editor is called /Applications/Utilities/AppleScript Editor.app.
    Also in snow leopard, Automator has some prebuilt functions for renaming files that can easily
    used to build an automator workflow used to find and rename files.
    Here is a little app I found you might want to try:
    http://web.mac.com/mickeyroberson/MRR_Software/NameChanger.html
    Here is another app:
    http://manytricks.com/namemangler/

  • Remove numbers after filename and add custom sequence?

    Hi,
    I have to rename quite much of rendered frames which names are like aoPass_000001.png...aoPass_099999.png. I have to replace those numbers to start from 0111111 for example witch I'll input manually when I run rename process. Right now I do it using Automator's Make Sequential and writing new name for it and giving new starting number. Yes, it's doable, but must be some better way to do?
    Also I have few different passes so file structure is like:
    - renderPasses
             - alphaPass
             - aoPass
             - beautyPass
    So I'd like to run for all sub folders at once if possible. They all do share same sequence numbers so maybe remove 6 characters from end might work keeping front side untouched.
    Doable with combinations of Automator or should I learn some Apple script...?
    Thanks!

    Applescript and Automater are discussed in Mac OS X Technologies
    I'll see if a host will move this.

  • Remove / Convert Alpha Channel using Automator?

    I'd like to take a series of Grayscale + Alpha TIFs and make them just RGB[A] TIFs. Basically this involves copying the Alpha channel to the R, G, B channels and then resaving as RGB TIFs.
    I am sure this could be done in Photoshop, but I'd really love to figure out how to do it in Automator. Or is this beyond the capabilities of Quartz?
    Thanks,

    In a possible seconding of such a function: Here is my wish: Ability to completely remove or mask an application-background, (either completely or largely render the application background as a transparent color. While keeping the application tool bars and the user's work visible.)
    Searching on line brings these up-- http://www.macupdate.com/info.php/id/24789/crystal-clear and http://www.unsanity.com/haxies/wsx

  • How to rename converted AAC filename using Nokia M...

    I'm using Nokia 3110. I encounterd some issue about the mp3 music fail to playback due to require activation code on my Nokia 3110 phone. I managed to overcome the activation code problem by using Nokia Music Manager. I just do not understand why this issue happen??? Because some of the songs from the same CD album do not have this activation code issue. FYI. I purhcase original CD.
    Second issue i'm still figuring is about how to rename AAC song as per my desire. The default file name after converted to ACC using Nokia Music Manager is 01-.AAC. I did try to rename it using Nokia Music Manager. But, once it downloaded to the phone. It still display the "original" file name, which is 01-.AAC. Please assist.
    Third issue is about the album information. How does Nokia Music Manager categories or get the "correct" album information? Some of the song name is incorrect after downloaded to the phone.
    from Music Lover

    Not come across the activation code issue at all.
    To stop the track number appearing in the file name:
    - open Music Manager (Transfer music option in PC Suite)
    - click Options .. Settings
    - unset the "Add track number to the file name when ripping content from CD" option
    You'll have to re-rip all your music again, though.
    If you don't want to do this, I'm sure there are tools around that will let you edit the track information in the file - try a search on this board or google.

  • Remove convert web page to pdf icon

    The convert web page to pdf icon, is just a link to d/l the software, and is totally useless after installing it. It shouldn't be sitting there permanently.

    Hi Ricer46!
    Click on tools and then Add-ons and then disable Adobe Acrobat - Create PDF and restart Firefox. That should do the trick.

  • Can you convert a filename to a keyword?

    I just read that Lightroom can execute script functions. I was curious if there is a way to take a file name, make some changes and then save them as a keyword.
    Thanks,
    Darrell Leland

    Yes.
    You can download the SDK here:
    http://www.adobe.com/devnet/photoshoplightroom.html
    To get started, lookup:
    * LrTasks
    * LrCatalog
    * LrPhoto
    * LrKeyword
    R

  • Save as tiff option needed

    I have generated a flowable XFA form that uses a javascript call to "save a file as a tiif" .
    this is working but -
    I need to be able to specify a few option about how it is saved - like - "monochrome" or 300 X 300 dpi , etc -
    right now the defaults are being used, etc -
    I am wondering if I can just update the defaults whenever my form runs - so that I get the same effect this would be very acceptable .
    Please assist -
    Thanks

    Try this:
    #target illustrator
    // PART 1 -> OK, this part works
    var doc = app.activeDocument;
    doc.artboards[0].artboardRect = doc.visibleBounds; //cropt de artboard naar enkel de figuurgrootte
    // PART 2 ->
    var destFile = new File(decodeURI(doc.fullName).replace(/(?: \[Converted\])?\.eps$/, '.ai'));   // also remove "[Converted]" from filename
    var options = new IllustratorSaveOptions({});   // new save as options
    options.compatibility = Compatibility.ILLUSTRATOR15;   // save as AI CS5
    options.pdfCompatible = false;   //I don't like it
    options.useCompression = true;   //I like it
    doc.saveAs(destFile, options);   // save the file in the same foldere as the eps
    // PART 3 -> OK, this part works
    doc.close(SaveOptions.SAVECHANGES);   // close the file with saving
    PART 4 -> change color profile
    Do you mean change colorMode? But there is no grayscale colorMode.

  • Save as-funcion - help needed

    Hello,
    The question is simple but the solution for me isn't so simple.
    An eps-file in Illustrator must be saved as an ai-file with the same name, but the extension must be ai instead of the original eps-file.
    Is it also possible to change the color profile from RGB/CMYK/... to grayscale?
    The problem is that Illustrator saves the file as undefined.ai instead of the <<original file name>>.ai
    #target illustrator
    // PART 1 -> OK, this part works
    var doc = app.activeDocument;
    doc.artboards[0].artboardRect = doc.visibleBounds; //cropt de artboard naar enkel de figuurgrootte
    // PART 2 -> don't work
    var docName=doc.fullname;
    destFolder = doc.path;
    var destFile = new File(destFolder + "/" +  docName + ".ai");   // make a new file in the dest folder
    var options = new IllustratorSaveOptions();   // new save as options
    options.compatibility = Compatibility.ILLUSTRATOR15;   // save as AI CS5
    options.pdfCompatible = true;
    options.useCompression = false
    doc.saveAs(destFile,  options);  // save the file in the same foldere as the eps
    // PART 3 -> OK, this part works
    doc.close(SaveOptions.SAVECHANGES);   // close the file with saving
    // PART 4 -> change color profile?
    I hope that someone can help.
    Thanks

    Try this:
    #target illustrator
    // PART 1 -> OK, this part works
    var doc = app.activeDocument;
    doc.artboards[0].artboardRect = doc.visibleBounds; //cropt de artboard naar enkel de figuurgrootte
    // PART 2 ->
    var destFile = new File(decodeURI(doc.fullName).replace(/(?: \[Converted\])?\.eps$/, '.ai'));   // also remove "[Converted]" from filename
    var options = new IllustratorSaveOptions({});   // new save as options
    options.compatibility = Compatibility.ILLUSTRATOR15;   // save as AI CS5
    options.pdfCompatible = false;   //I don't like it
    options.useCompression = true;   //I like it
    doc.saveAs(destFile, options);   // save the file in the same foldere as the eps
    // PART 3 -> OK, this part works
    doc.close(SaveOptions.SAVECHANGES);   // close the file with saving
    PART 4 -> change color profile
    Do you mean change colorMode? But there is no grayscale colorMode.

  • Embed all fonts in eps

    I have a lot of existing eps-files of which the option "embed all fonts" is unchecked.
    Know I have to check the "embed all fonts" in the existing eps-files.
    I tried to modify the script below, but it seems that the embedallfonts is NOT working.
    When I do it manually (without script), then it works fine. With script, it doesn't work.
    #target illustrator
    // PART 1
    var doc = app.activeDocument;
    // PART 2 -> herbewaren eps als eps
    var destFile = new File(decodeURI(doc.fullName).replace(/(?: \[Converted\])?\.eps$/, '.eps'));   // also remove "[Converted]" from filename
    var options = new IllustratorSaveOptions({});   // new save as options
    options.compatibility = Compatibility.ILLUSTRATOR15;   // save as CS5
    options.embedICCProfile=true;
    options.embedAllFonts=true;
    options.pdfCompatible = true;
    options.useCompression = true;
    doc.saveAs(destFile,  options);  // save the file in the same foldere as the eps
    // PART 3
    doc.close(SaveOptions.SAVECHANGES);   // close the file with saving
    Another question will be: can I get a dialog box to put in the path to the eps-files, I can do thereafter it in batch instead of each time opening and closing a file.

    For the people who are interested. This script asks for a source and target folder, opens an ai or eps file, save to an eps file with fonts embedded, create automatic a scaled png folder and close the file(s).
    #target illustrator
    var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, pngExportOpts;
    // Selecteer de bronfolder.
    sourceFolder = Folder.selectDialog( 'Selecteer de folder met je files die je wil converteren naar PNG', '~' );
    // indien folder geselecteerd is dan....
    if ( sourceFolder != null )
        files = new Array();
        fileType = prompt( 'Welke type files wil je herbewaren als eps met embedded fonts en converteren naar png? Voorbeeld: *.ai', ' ' );
        // controleer of alle files aan de juiste extensie voldoen zoals aangegeven hier net boven.
        files = sourceFolder.getFiles( fileType );
        if ( files.length > 0 )
            // folder opgeven waar de png-files bewaard moeten worden
            destFolder = Folder.selectDialog( 'Selecteer de folder waar de geconverteerde PNG-bestanden bewaard moeten worden.', '~' );
            for ( i = 0; i < files.length; i++ )
                sourceDoc = app.open(files[i]); // returns the document object
                // Call function getNewName to get the name and file to save the pdf
                targetFile = getNewName();
                // call funtion getEpsoptions
                epsExportOpts=getEpsOptions();
                // Call function getPNGOptions get the PNGExportOptions for the files
                pngExportOpts = getPNGOptions();
                // Export as PNG
                sourceDoc.exportFile( targetFile, ExportType.PNG24, pngExportOpts );
                // save as eps but with extra options like embed all fonts checked
                sourceDoc.saveAs(targetFile,epsExportOpts);
            alert( 'De bewaarde PNG bestanden staan in volgende folder: ' + destFolder );
        else
            alert( 'Geen files gevonden!' );
    getNewName: Function to get the new file name. The primary
    name is the same as the source file.
    Functie om de nieuwe filenaam te genereren. De oorspronkelijke naam wordt gebruikt (zonder extensie)
    function getNewName()
        var ext, docName, newName, saveInFile, docName;
        docName = sourceDoc.name;
        ext = '.png'; // nieuwe extensie voor PNG
        newName = "";
        for ( var i = 0 ; docName[i] != "." ; i++ )
            newName += docName[i];
        newName += ext; // volledige naam van nieuw bestand inclusief png-extensie
        // nieuwe file maken met correctie extensie
        saveInFile = new File( destFolder + '/' + newName );
        return saveInFile;
    getPNGOptions: Function to set the PNG saving options of the
    files using the PDFSaveOptions object.
    Hier worden de PNG opties beschreven (= als je een opslaan als selecteert, welke opties je aanvinkt en uitvinkt.
    function getPNGOptions()
        // Hier worden de PNG opties beschreven (= als je een opslaan als selecteert, welke opties je aanvinkt en uitvinkt.
        var pngExportOpts = new ExportOptionsPNG24();
        // Setting PNGExportOptions properties. Please see the JavaScript Reference
        // for a description of these properties.
        // Add more properties here if you like
        pngExportOpts.antiAliasing = true;
        pngExportOpts.artBoardClipping = false;
        pngExportOpts.horizontalScale = 200;
        //pngExportOpts.matte = true;
        //pngExportOpts.matteColor = 0, 0, 0;
        pngExportOpts.saveAsHTML = false;
        pngExportOpts.transparency = true;
        pngExportOpts.verticalScale = 200;
        return pngExportOpts;
    function getEpsOptions()
        var epsExportOpts = new EPSSaveOptions();   // new save as options
        epsExportOpts.compatibility = Compatibility.ILLUSTRATOR15;   // save as CS5
        epsExportOpts.embedICCProfile=true;
        epsExportOpts.embedAllFonts=true;
        epsExportOpts.fontSubsetThreshold = 100.0;
        epsExportOpts.pdfCompatible = true;
        epsExportOpts.useCompression = true;
        return epsExportOpts;  // save the file in the same foldere as the eps

  • Converting Filename Encoding

    Hello, I am trying to extract a .zip archive that contains CJK characters in its filenames. It was most likely created on a Windows machine.
    I tried the unzip utility and it produced invalid symbols. The same with 7za, but with slightly different ones. My LANG variable was set to en_US.UTF-8, but setting it to ja_JP.ujis seems to have no effect. I'm assuming that this means that the CJK filenames were encoded into the archive in a format other than UTF-8, and I need to convert it to UTF-8 for them to display properly.
    I know of convmv, and I used a shell script to test every possible encoding from `convmv --list` to no avail. I have the Unicode equivalents of the filenames for the most part, but in a format that's cumbersome to manually rename all of them, but with them I can verify if the conversion was successful or not.
    Observing the hex dump of ls and with positional deduction I concluded that U+4EBA (人) is represented as 0xC9 0x6C with the unzip output and 0xC2 0x90 0x6C with the 7za output. This also means it isn't impossible that I'm not dealing with the original encoding in the first place.
    So, why would two zip extractors produce different results, and are there any other leads to help me convert these filenames to UTF-8 correctly?
    Last edited by Cinolt (2011-04-14 00:26:41)

    Well. It looks like running WinRAR with ja_JP.utf8 seems to work.
    If wine can emulate it to work, it must work somehow natively in Linux. Even though I can get it to extract correctly I'd still appreciate if somebody could teach me the "proper" way to do it.

  • Batch rename does not remove original filename

    Bridge CS4 ver 3.0.0.464
    Not sure what I am doing wrong but when I try to batch rename my files for some reason I cannot remove the origanal filename,
    I have checked the preferences and searched for a solution and have come up with nothing.
    Any help would be great. Thank you.

    This has fixed the issue, however it is not really an ideal solution as it deletes all custom preferences, was there not a way to to reset just the renaming preferences?
    Thank you anyway, I forgot about cntrl bridge!

Maybe you are looking for

  • Budgeting & Workflow variant

    Hi S.A.P Gurus Need to create Budgets for various locations, but i am able to create only on e FM area per company code. Can anyone tell me how the same can be done Workflow variant in compay code. How do i create the same & can you tell me the purpo

  • Accidentaly set up my iphone as new, instead of back up...

    Hi All, I accidentally set up my new Iphone5s as a new phone, instead of setting it up as a back up from my Icloud. How do I reset my phone from my cloud without losing any information from the cloud account? Thanks, Reuben

  • Is Shake as good for miniDV footage?

    This is also posted at creativecow: I want to take on a project that will involve various tools/effects. I'm researching Shake (now that it's $499) and it appears to be the right tool for the job. However, I've only used FCP and your knowledge will b

  • Infoset query data display problem

    Hi Experts, I have created a infoset using SD and AR cubes. On this infoset i have generated a report taking Debit,Credit and Deb/Cred Amount. It is giving me the correct results. But when I have changed the query by adding the NetValue to that query

  • Urgent question to service desk

    Hi! I configured a service desk. It work's very fine. Some of my support teams have a lot of members. My organisational model is configured well, too. My support teams rule, to finde the right support team, if a message is incoming, works fine. my Qu