Remove the prefix of file name when exporting to PDF

Hello

Here I found a script that exports the current document in PDF format on the desktop.

I would like for it to change the file name as the first two characters are deleted.

Example:

The existing file name is: X_pagelayout.indd

I want this script to create a PDF file called: pagelayout.pdf

Thoughts?

Your help is very appreciated.

var = myFolder ' ~ \Desktop ";

myDoc var = app.activeDocument;

var myDocname = myDoc.name.split (".indd");

myDoc.exportFile (ExportFormat.PDF_TYPE, file (new file (MyFolder + "\" + myDocname.join (".pdf")));)

I just tried this and it works fine now...

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

var = myFolder ' ~ \Desktop ";

myDoc var = app.activeDocument;

var myDocname = myDoc.name.split ("_") [1];

var myNewName = myDocname.replace(/.indd/gi);

myDoc.exportFile (ExportFormat.PDF_TYPE, file (new (MyFolder + "\" + myNewName + ".pdf")));

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

Thank you both for your help - you are gentlemen, scholars and philanthropists

Tags: InDesign

Similar Questions

  • Export of Photoshop CC: unable to paste text in file name when exporting

    Hello

    Recently I tried to paste in some text my Clipboard file name when the "export as" in Photoshop and paste functionality does not seem to work at all, BUT if I use 'save for web', I can paste the text in the file name my Clipboard without problem. Not sure if this is a bug or intentional? Either very frustrating. Help, please.

    I have noticed this problem using export as on the CC 2015.1.2 with my Mac.

    It was reported and recognized as a bug and a request has been sent so that it can be fixed.

    Photoshop CC 2015 - is unable to paste it in the text field, if you choose to ' export as... ". » | Community customer Photoshop family

    Nothing wrong on your side. Just wait for the fix.

    Gene

  • How to remove the header and page number when converting to PDF

    I am using Windows 7 and you have Acrobat 8.1 installed. When I right click on a .txt file and choose "Convert to Adobe PDF" in the context menu, it will save a pdf file in the same folder as my file with the same file name .txt. When I open the pdf file, there is a header with the file name and page numbers at the bottom.

    How can I adjust the preferences to omit the header and page numbers? I have a click with the right button on the Adobe PDF printer in the control panel "Printers" and looked through properties and 'Adobe PDF settings' in the preferences, but don't find any options for headers and footers.

    Thanks in advance.

    What you describe is based on the configuration of the running text editor.
    Here, the configuration is such that the content described is part of what is migrated to the PDF file when the PDF is created.

    Modify the appropriate configuration of the text editor and the created PDF will no longer spam.

    Example - using Notepad window:

    Click path = file - layout

    In the presented dialog box, you can adjust the configuration.

    While Acrobat "PDFMaker" allows configure us the interactive "improvements" and others as in a file PDF created, it is always application configuration of creating files creation that sets the 'meat and potatoes' of the content of the PDF created.

    Be well...

  • Help with a javascript - need the name of the document file name when exporting

    When I run this script:

    var myPresets = app.pdfExportPresets.everyItem () .name;

    myPresets.unshift ("- select preset-");

    var myWin = new window ("dialog", "PDF Export Presets'");

    myWin.orientation = "row";

    {with (myWin)}

    myWin.sText = Add ("' statictext ', undefined, ' select PDF Export preset :');)

    myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});)

    myWin.myPDFExport.selection = 10;

    myWin.btnOK = Add ('button', undefined, "OK");

    };

    myWin.center ();

    myWindow var = myWin.show ();

    If (myWindow == true & & myWin.myPDFExport.selection.index! = 0) {}

    var myPreset = app.pdfExportPresets.item (String (myWin.myPDFExport.selection));

    myFile = lead (File.saveDialog ("save the file with preset:" + myPreset.name, "PDF files: *.pdf"));

    If (myFile! = null) {}

    app.activeDocument.exportFile (ExportFormat.PDF_TYPE, myFile, false, myPreset);

    } else {}

    Alert ("no file selected");

    }

    } else {}

    Alert ("no predefined PDF selected");

    }

    I need to place the filname document automatically when the dialog box "Save as" appears:

    Udklip.PNG

    Can someone help me?

    Use this:

    myPath = app.activeDocument.filePath + '/' + app.activeDocument.name.replace (/\.indd$/, '.pdf');
    myFile = File(myPath).saveDlg("Save file with preset: " + myPreset.name,"PDF files: *.pdf");
    

    Peter

  • Keep file names when exporting out of iTunes

    Hello

    I save a lot of interviews on my iPhone, and transfer it to iTunes as a dictaphone. Now, I'm running out of space on the hard drive of my MacBook and export them on a separate hard drive. It's the Act of exporting the names of changes to a date. It's no good for me because I need them to be searchable.

    Does anyone have an idea how to do that?

    Thank you very much!

    I have no voice recorder, so I'm not familiar with the files.  Be aware of what you see in iTunes is not the name of the file it's data embedded in the file tags.  You don't say what you mean by "export." There is an export feature, but who simply produces a list of titles, not the files themselves.

    You may need to rename the files according to the track tag information.  See the website Dougscripts for a File Renamer script that does this.

  • Objects in InDesign files disappear when exporting to PDF (CS5.5)

    I have a text that was created in text converted to outlines, filled and has a drop shadow applied. When I export the document to PDF, part (fill) text disappears, and all I get is the shadow. I tried to change a color non-spot, I tried to remove all attributes, and nothing seems to work! I also tried to copy this work to the Clipboard and paste them into an Illustrator file (says that it's too big to fit the editing table, which I checked sizes - and it must adapt. I tried to copy the paths and sticking them in Photoshop as a smart object... no chance either. What Miss me? Thanks in advance for any help!

    I hate to suggest it, but have you tried the PDF instead of export of distillation? It seems to me, too, as there is a problem in the file, and sometimes still work if an export will not. What happens if something do you know the history of this file?

  • Only black color on the linked indesign files conversion 4 black color process when exporting to PDF?

    I have a paged presentation that contains multiple indesign files linked. They have two colors: black to 100% and a spot color. If I export the files related, using the same PDF preset, the colors are kept, but when exporting from layout with them tied it converts black in 4 colors. I checked the separations on the layout file but they are all very good. It's just a bug or am I doing something stupid?

    What happens when you color manage CMYK to another space CMYK, try using PDF X / 1 setting first and make sure that preserve numbers is set for the release, let us know how it goes.

  • Can I remove the old update files that have already been applied?

    Good evening! I just a quick may be a dumb question... when I've updated my computer, if I remove the before update... like when a service pack number, as for example I downloaded the number of service pack 2 What do I do with the number of the service pack 1? delete it?

    Depends on the operating system - Windows

    Please note this is only for Windows XP and is not on Vista or Windows 7

    Folders that have uninstall as part of the name (for example $NtUninstallKB282010$ who reside in C:\windows (hidden files) are window Hot difficulty updating folders/files) can be removed safely (providing ever, you wish to uninstall the updates). I recommend you leave these records for a period of at least one month to make sure that the update works correctly.

    These updates can be removed individually or together. To learn more about the update/s go on:
    http://support.Microsoft.com/kb/xxxxxx
    NB: XXXXXX = the actual number, not to mention the "Q" or "Ko."

    Once you have removed the uninstall folders/files, then go to control panel, add/remove programs. Select the title of the corresponding Windows fix on the folder/file of the patch you just deleted, and select Delete. You will get a Windows error. This is because you deleted the uninstall folder/files. Simply choose OK and the entry will be removed from the Add/Remove Programs list.

    Don't NOT delete the folder $ $hf_mig

    Cleaning after installation of SP2
    http://aumha.org/win5/a/sp2faq.php#after

    and/or

    XP SP3: Post Installation Cleanup
    http://aumha.NET/viewtopic.php?f=62&t=33827

    For Vista and Windows 7

    The update uninstall method in Windows Vista is quite different from that in Windows XP.

    Uninstaller for each update folder no longer exists in Vista and the uninstall information is stored by the Volume Shadow Copy service.

    After each update, Volume Shadow Copy service backup only the updated files.

    So with Vista, it's a differential backup, rather than a full backup files for uninstall
    in Windows XP.

    This safeguard mechanism is used to save disk space.

    So basically, you are unable to manually delete the uninstall it from the computer.

    TaurArian [MVP] 2005-2011 - Update Services

  • If we can remove the prefix ADITResource? ~

    Hello
    Is it possible to remove the prefix ADITResource? ~ Is it a running course? What I want is to display only the value decoded on the application form (for the commissioning and haikus AD RO). In my case when I configure custom search on request data overall, the list of ad groups is filled with the exact names (description of the AD Group for example), but after reconcile us the user AD, the values are changed to ADITResource ~ group name and the lily of ad groups on change reqest data set is 'empty' - I see empty lines. If I change the code of research do not cut ADITResource ~ the list is correct. How always show decoded only value?
    Best
    MP

    Yes you can remove, but you must use SQL Query to do this.

    Yes, it's sure that it's just a value decode and IOM uses the value encodes for the operation. Even if it's in the Code value then also you can delete this key code as well.

    If you use a Dataset, then you can simply create function in SQL that will cut (substring) this ADITResource ~ and shows the value of Decode table LKV / HGLN. For your query search display field will be LKV_DECODED and save the field will be LKV_ENCODED. At the time of the selection, it will display the values ENCODED and DECODED but when you click on submit, then it will display only LKV_DECODED

  • How can I get the 8.3 file name short AND way?

    We use some old DOS programs and need to use the old format back (filename.xxx). When the files are in the long trees, it is very difficult to find the names of files under Windows.

    There was a response published in Google (http://answers.google.com/answers/threadview/id/522710.html) which works very well under XP, but when I use it in Windows 7, I get the long file name.

    Does anyone know how to do this?  The program can be changed?  Here is the program of this flajason-ga posted, but it must be updated for Windows 7 (I only know how to program in Foxpro).  Thank you, Alan

    Topic: Re: how to get the 8.3 file name short AND path?
    From: flajason-ga on May 27, 2005 10:45 PDT
     

    After my last comment, I read your details a little closer.
    The last script I posted was to list out a whole directory in 8.3 format.
    If you are looking for a friendly way of Clipboard to recover the 8.3
    for individual files, that will be more to your liking.

    Same thing as before. Copy the below into Notepad and save it with a .vbs extension.
    Except that this time, you can simply drag and drop a folder or file icon
    on the .vbs file and it displays the short path in an input box.
    where you can copy the value and use anything you want to.

    If you're industrious, you can also save the .vbs file in your
    Folder "send to" (C:\Documents and Settings\ [yourname] \SendTo) to have
    It is available in your context menu with a right click.

    Set fso = CreateObject ("Scripting.FileSystemObject")

    ' Is a file or a folder?
    If fso. FolderExists (WScript.Arguments (0)) then
    "It's a folder
    Set objFolder = fso. GetFolder (WScript.Arguments (0))
    Refund = InputBox ("this is your short path:", "SHORT PATH", objFolder.ShortPath)
    End If

    If fso. FileExists (WScript.Arguments (0)) then
    "It's a file
    Set objFile = fso. GetFile (WScript.Arguments (0))
    Refund = InputBox ("this is your short path:", "SHORT PATH", objFile.ShortPath)
    End If

    Hello

    Read the following article.

    How Windows generates 8.3 names to long file names
    http://support.Microsoft.com/kb/142982

  • While I'm trying to remove the MPEG-4 file, it says "make sure that the disk is not full or write protected and that the file is not currently in use.

    Original title: When I'm trying to delete file MPEG4, is not deletion. How can I delete file MPEG4?

    While I'm trying to remove the MPEG-4 file, it says "make sure that the disk is not full or write protected and that the file is not currently in use.

    Hello
     
    Method 1: Ownership of the file and then try to delete and see if that helps.
    Reference:
    How to capture a file or a folder in Windows XP
    http://support.Microsoft.com/kb/308421
    Method 2:
     
    Error message when you try to delete a file in Windows XP: "access denied".

    http://support.Microsoft.com/kb/298345

  • Problems with the "use tiny file names...". "checkbox in the settings of WebHelp box

    Given that the RH 9 is only able to run on Windows, the checkbox "Use tiny file names..." ' (see image below) can cause some unexpected problems when generating output for a unix (or linux) platform. I found this recently when generating output of web for a project that is visualized on a linux platform machine and met hundreds of broken links unexpected help.

    WebHelp Settings - User LowerCase for Unix.jpg

    If this is the first time you generate your project output, this function works very well - it converts all topics, image files and all what it takes to display help, lower case. However, if for some reason, you had generated previous outputs without this box, and now you have decided that you want all your files output in lower case, just check this box and regenerating the output will not work.

    The reason is simple - the Windows operating system does not distinguish between upper and lower case in file names (e.g., fichier.htm name is the same as the FILE name.) (HTM). UNIX (and linux) are case-sensitive and treat these files are two separate files. Therefore, HR fact not (cannot) change existing file in your folder names with this checked out and gives no message indicating such when generating the output. In this case, the only way to solve this problem is to delete the folder containing your output files and have HR to regenerate your project from scratch.

    I had an additional problem which has made things even worse. In a project for a linux platform, I have unchecked the box during the creation of project by accident (perhaps over a period of days or weeks). Then, due to another problem, I had to restore my project at an earlier stage. At this point, I discovered that my necessary help links of the files using lowercase and uppercase the filenames for all work very well.

    I've seen no mention of this in the HR documentation, so I thought that I must draw the attention of the HR community.

    Yes - just to clarify, I'm taking everything I publish on.

    Reminder - just those who publish in a Unix/Linux warning environment if you need to change the case of file names in your folder you post on and you already have stuff in there with the same name, you will need to delete the files first before you republish.

  • What do I have to remove the battery from my PC when I connect it with the cable?

    So that the battery do not damaged.
    What do I have to remove the battery from my PC when I connect it with the cable?
    Tell me what I need to do for that battery not damaged

    Hi mate,
    Don t worry, just use your machine and leave your battery in your machine, because an electronic load look at your battery, so no damage will be caused.

    You know, technology is in fact at a good level and I think it s ok to operate your machine with cables and battery SET. :

    Greetings

  • How to remove the recovery disc files D?

    Original title: drive D

    How to remove the recovery disc files D?

    Hello

    It is not recommended to delete the files in the recovery partition.  Recovery partition contains the Windows information to retrieve the computer crashing. I would ask you to contact the manufacturer of the computer on it.

    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • I want to install the oil for CC for Mac photoshop painting. Where can I find the appropriate download file? When I try to install this "pixelbender_toolkit_2.5.dmg", I get "installation is damaged and cannot be opened.

    I want to install the oil for CC for Mac photoshop painting. Where can I find the appropriate download file? When I try to install this "pixelbender_toolkit_2.5.dmg", I get "installation is damaged and cannot be opened.

    Oil filter is back in Photoshop was last updated. Just make sure that you have installed.

Maybe you are looking for

  • Why won't the Web sites I use, myfrenchlab, facebook, no charge?

    This happened for two days. On facebook, my chat bar never loads. He said only "loading". When I try to click on the button of my message, nothing ever happens. When I try to access a page that I "liked" and enter a contest in a tab, it never loads.

  • Low screen on my Satellite Pro A60-191 image quality

    Hello Today, when I came to this site I noticed it is of poor quality lines down on the grey area of this site (under the TOSHIBA logo) I can't show you because the camera does not have a picture of the lines. also when I go on to a new folder before

  • Installation of Linux FPGA worker compilation files?

    I'm looking forward to trying the new worker of compiling Linux FPGA: http://www.ni.com/white-paper/14039/en Where do I download Linux installation files?

  • Error-2501 TDMS invalid of the file reference

    Hello. I'm using LabVIEW 2013 for myRIO on Windows 7. Im trying to perform a simulation to the readings of sensors from 0 to 5, then disconnect the data. Ive used the random number generator to get readings. So my code works very well (or almost), as

  • XZ phone great sleeves and drains battery fast

    Hello According to the instructions provided in the manual, I loaded the phone for 30 minutes before turning on.  The phone got overheated and he radiated energy right heat, which clearly felt in the Palms when we organize it. Also when I was on duty