Inserting a constant after a file name

Hello all,
I have been working on a Javascript for Acrobat Pro 9, which I want to pull the first page of a PDF file & move it to another folder, I have managed to achieve this, however it would also be useful to insert an additional part to the file name...
/* Extract Cover Page Only As PDF */
// regular expression acquire the base name of file
var re = /.*\/|\.pdf$/ig;
var filename = this.path.replace(re,"");
try {
i=0;
this.extractPages(
nStart: i,
cPath: "/C/Documents and Settings/JBushfield/Desktop/Output/"+filename+".pdf"
} catch (e) {
console.println("Aborted: "+e)
I can get the script to insert a prefix to the file name but when I try to move it to after the filename ie just before the .pdf it won't play ball. I talked a colleage, who suggested that maybe as the filename is (to Adobe) variable (it's actually always 13 digits as it is an ISBN), that maybe there is someway to include this, as in place text in name after the 13 digits but I am not sure.
PS The text I want to include after the ISBN is "_Outside_Front_Cover"
Any help on the matter would be greatly appreciated,
Many Thanks
Joe

Hey Try67,
Thanks so much for helping me out here, your solution works! In actual fact I hadn't tried that, I'd closed it off ..._cover with " before the .pdf, I guess that was it, you've really helped me here! Thanks for the support, I'm pretty new to Javascripting and you've given me that extra bit of motivation.
Thanks
Joe

Similar Messages

  • Insert a directory path and file name option

    I built a program that runs three tasks when a voltage triggers the data acquisition. I would like now to insert an option/control for two issues: selection of the directory where the data will be saved, and selection of the file name. How can I do this such that after I press 'start' I should be asked which is the directory where I want the data to be saved and then what is the file name?
    Another option would be the following: After I press 'Start' I will have a control where I can write or browse for the folder where I want to save the data; then I have another controller where I write the new file name. So in this case I should not be prompted except the case when I am trying to use the same file name.
    Where should I con
    nect this new subvi in my loop - before the tasksand before the trigger, or after the tasks and before the trigger?
    Thank you.

    Programming with LabVIEW might be fun but it is quite time consuming�
    OK, here is what I want to do.
    I have to monitor a machining process. I have to record cutting forces, power consumed, vibrations, and temperature. From each of these sensors I get a voltage as output and I used �Measurement and automation� and NI-DAQmx to program my tasks (I have LabVIEW Express running in Windows XP).
    The triggering of DAQ is generated by the input of a 4.5V DC when the CNC program starts; the stop occurs when CNC program ends and the output voltage becomes 0V. I have finished all the connections and now I have to build the vi.
    The �small picture� could be described this way:
    I want to record the parameters and save them in files that I could process later using specific vi.
    The �big picture� would be the following:
    I would like to build a stand alone program that will do the following: when I run the program [ i. e. double-click the shortcut (or the file)] a panel should come up in the center of the screen � in this panel I would like to be able to select what process am I going to investigate: grinding, turning, milling, drilling, tapping etc.
    Once I selected what process I am going to investigate, the front panel of a vi should come up � In this panel I should be able to select what parameters I am going to record: forces, power, vibrations, and temperature. On the front panel I should be able to see the waveform of the acquired data. A start/stop button and a led green/red for each parameter should show me the status of the acquisition (green is on, red is off). The start/stop button should allow me to �manually� start or stop the program at any time. Additionally, on the front panel I should also have icons with a choice for directory (folder) path, file name, and comments regarding the experiment. The date and time should be recorded in the file that is saved. There should be an option (check box or selection icon) for saving the data in binary or ASCII format.
    Similar to any program, the front panel should have a toolbar containing File, Operate and Help options. The File option should contain �Clear graphs�, �Setup DAQ� and �Exit� and the Operate option should contain: Use digital alarm, Use digital trigger, and Write data to disk with the option to be selected or deselected. The main front panel should close when I select File -> Exit.
    The File -> Setup DAQ selection should bring up another front panel in which I should be able to see the acquisition control panel (device, channels to get, buffer size, units � English or metric) and the calibration factors (for the tasks, including triggering voltage) including sampling rate.
    Well, that�s almost all. I understand I cannot do this all at once. Unfortunately, I have a very close due date in getting the system up and ready. I am hoping that I could get some help setting up a simple program and I could develop the rest step by step later...
    Can anybody help me with this program? I have attached a first attempt that would allow automatic triggering and stopping as well as displaying of forces, power and acceleration.
    Thank you in advance.
    Radu
    Attachments:
    Acq_Graph_Voltage-Int_Clk-Dig_Start_Ref_TRIAL1.vi ‏201 KB

  • How do I reconnect media after changing file name?

    The original file name is 1001.WAV I changed it to Take1 . How do I relocate the files? I use Pluraleyes to sync all my files.
    Cheers, Greg

    Change it back.  NEVER change file names in the Finder level if the media is in an FCP project.  Change it BEFORE you import it into FCP...or change the name IN FCP.  What you did was bad bad wrong wrong. Expecially since you already did things like sync it up with pluraleyes.
    Change it back.  Then change the name in FCP.

  • External table fails to view data after changing file name

    Hello,
    I have previously imported 122 external tables and was able to view their data without any problems.
    The names of these files have since changed. The names have a date in them.
    So I dropped the external tables from that database and recreated them with the new file names.
    I then went into OWB and dropped them from OWB.
    I reimported all of the tables without errors.
    I go to view the data and get an error that the file does not exists.
    The problem is that the file it is telling me does not exists, is the file I had been using last week. Not the new file.
    However, when I go and right click the external table and do a configure, the correct name is showing up under datafiles.
    It's almost as though when I dropped the external tables, not everything was cleaned up. For whatever reason, OWB is still using the old names.
    Dan

    Hi there... Wich OWB version are you using?
    If you've created this external tables using any other tool (ie: SQLPLUS, SQLDeveloper, Toad, SQLNavigator, etc), are you able to query this objects from one of these tools?
    If you've created this ET's using OWB, are you creating it as external tables or are you mapping it as source flat files?
    If you are using OWB to create it, there are a few configurations/properties you should change to have them running well.
    Please, post some more info.
    Thanks

  • When saving files as JPGs they save as 'files' and are not able to be re-opened by Photoshop.  This is only correctable by manually typing in .jpg after the file name.

    For some inexplicable reason when I save jpeg files they save as 'files' which can then not be re-opened.  I can only temporarily solve the problem by typing 'jpg' after the name as well as selecting jpeg as the type of file.  Do I need to change some other setting?

    David,
    I don’t have the option to append the file extension.  I am using:
    Adobe Photoshop Elements Version: 11.0 (11.0 (20120830.r.32025)) x32
    Operating System: Windows 8 64-bit
    Version: 6.2
    Any ideas?
    Thanks,
    Rich
    Sent from Windows Mail

  • Preserving Ranking after Changing file name in feed

    We are in the process of updating some of our collection to high quality SD video (640 x 360) and adding an HD (12800 x 720), which requires us to point to new files in the current sd feed. It seems that by doing so, we are losing the ranking for that particular item even though we preserved the GUID.
    Any ideas on how to preserve the rankings while we're going through the process of upgrading the quality of our videos?

    As long as you retain the same GUID, the ranking will be preserved. If you submit different GUID to the server and then change it back to the old GUID however, as we don't keep history of GUIDs, your ranking will be lost.
    Hope this helps
    iTunes U Team

  • Some items in finder windows have gray dots after file names

    When I open a finder window for the current directory, some of the file name shave little gray dots after the file names, off to the right at the end of the name field.  What do they mean?  Mavericks 10.9.4 on a 2009 Mac Pro.

    It means that the gray tag has been assigned to them.
    (110820)

  • Oracle Solaris Zip files names

    Hi,
    I am going to install oracle on solaris.I downloaded 9i sotware from oracle site and wrote it in cd's. The zip file name is 92010Sol_Disk1.cpio.gz.
    When I insert the cd the zip file name is showing differenlty like 920_0001.gz.
    My question is why its showing different file name?
    THanks.

    Sounds like the program changed the long name to an 8.3 file format.
    This is an 'old' article, but it may pertain to what happened:
    http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/win9x/lfn_4ugj.asp
    To quote the propaganda:
    If the long file name does not follow the standard 8.3 format, the system automatically generates an alias, using the following scheme to ensure that the alias has a unique name. The system tries to create a name by using the first 6 characters of the long file name followed by a numeric tail. A numeric tail consists of the tilde (~) character followed by a number. The system starts with the number 1 in the numeric tail. If that file name already exists, it uses the number 2. It continues in this fashion until a unique name is found. If the long file name has a file name extension, the system will use the first three characters of the long file name's extension as the extension for the alias.
    As the number of digits in the numeric tail grows, fewer characters in the long file name are used for the 8 characters in the alias. For example, the alias for Long File Name.File would be LONGF~10.FIL if the names LONGFI~1.FIL through LONGFI~9.FIL already existed in the directory. Applications can override the default alias numbering scheme when creating a file by specifying the OPEN_FLAGS_ALIAS_HINT value and supplying a number to use in the call to Create or Open File (Interrupt 21h Function 716Ch).
    A period is just another character in a long file name. Leading periods are allowed in a long file name, but trailing periods are stripped. A file can have multiple periods as part of its name. For example, MyFile.081293.Document is a valid file name, and its alias will be MYFILE~1.DOC. The first three characters after the last period in the file name are used as the file name extension for the alias, as long as the last period is not a leading period. A file name of .login is also valid, and its alias is LOGIN~1.
    So it [the software creating the cd] could have changed 92010Sol_Disk1.cpio.gz into 920_0001.gz.

  • Sender File adapter - DataTime stamp at the end of aarchived file name

    Hello,
    I am archiving the file once PI file sender adapter picks the file from source directory.
    The file is archived in the archive directory as <Date-Time-SSS_>FileName.
    I need to append the value <Date-Time-SSS_> after the file name.
    So archived file looks like FileName_<Date-Time-SSS>
    How can I achieve this? Appreciate your help for valuable suggestions.
    Thanks,
    Namadev

    Hi Namdev,
    Generally when we archive file then in sender CC we just put the processing mode as Archive and specify the Archived directory name in Archive Directory section. in that case when the Communication channel pick the source file then after picking it it remove it from source directory and put it into Archived directory without making any change in the file name.
    so if the file name is A.txt then in Archived directory also its name will be A.txt . However if you want to make any change in the name of the source file in the archived directory then you have two write Unix or DOC scrpt( depending upon your soure server )
    if your source server is Unix then write shell script otherwise dos scriprt
    .after wrtting the shell script just place in the archived directory or your source directory and call it in by mentioning it in Coomand Line section of your sender CC. You can easily search and get the required  shell script .
    Regards,
    Saurabh

  • Symbol at end of file name prevents email recipient from opening PDF

    The special symbol looks like: ˥  However, there is a tiny little arrow that is on the end of the horizontal part that points left. It is located immediately after the file name, but before the .extension. I have been sending out resumes and the ones that appear with this symbol in the shadow box (the file name box that appears if you hover over the icon once it has been attached via email) appear as a blank (but gray) PDF once it is opened by the recipient.
    What is this and how do I stop it?
    Thanks

    Please let me know the following details:
    1. Which version of Adobe Reader are you using (You can check the same from Help > About Adobe Reader)
    2. Which OS are you using?
    3. How exactly are you attaching the PDFs to the emails? Are you using the Attach to Email functionality from within Reader? Or are you attaching them by yourself?

  • How to Read file name which we are dealing with ODI File tool

    Hi,
    We are using ODi10g version and we have requirement to move file from one place to another place. We are using ODIFileMove utility but we also want to read file name.
    Any help.
    Thanks in Advance.

    You can accomplish this with a fairly simple Jython script.  Use the os.listdir(<directory>) command to get the name of files in a given directory. 
    You can then (still in the Jython script) loop through the files and move them to a desired location (bypassing the OdiFileMove tool) OR use the Jython script to write the file names to a SQL table.  Then, use an ODI procedure to loop through the newly inserted records and store the file name in an ODI variable that you can then use in your OdiFileMove tool etc.
    I often refer to this blog entry from Gurcan Orhan as a starting point for this kind of task: Loading multiple files with ODI | Gurcan Orhan&amp;#039;s Oracle Data Integrator Blog

  • Relinking to modified file names is working in CS3 and not in CS2

    We are trying to remove a few characters identified as illegal(cannot be used in the file names in Windows) from the file names and then modify the InDesign layout files to relink to the modified file names. We are using the InDesign CS3 server to open up the application and work on the layout files using Java and CORBA mode(used CS3 SDK). First we remove the illegal characters from the file names. Next we will go through all the links in a layout file and will identify the links with illegal characters and relink it to the modified files. The relinking will happen to only those files which has a state NORMAL before the file names are modified. This approach works fine for the CS3 files but for CS2 after the file names got modified the link rolls back to the file path on the original m/c where the link was created and the relinking is not working.
    Have anyone did something similar to that, if so can you provide with some details on how to address this issue.
    Do let me know if you need any more specific information for providing your inputs to address this issue. Any inputs will be highly appreciated.
    Thanks

    Thanks. I got it resolved by saving the document by passing in a OptArg.makeFile() instead of OptArg.noFile(). I modified this based on what I read from Adobe Livedocs which said that any CS2 file opened in CS3 will be converted to CS3 and will be considered as a new document.

  • Saving internet file now results is meaningless alphanumeric file name instead of doc name

    A few weeks ago reader X suddenly started puting all the tools (like save file) back in the top of the window. They were missing for quite some time and very frustrating. I could find no way to bring them back.  Now, however, whenever I save an internet file, a short meaningless alphanumeric name is inserted rather than using the file name/document name that has always been used before. Is there a way to return this to previous behaviour?

    Hi,
    I'm sorry you are having this problem, here is another post about the same problem, where the cause of the problem is described:
    https://support.mozilla.com/en-US/questions/894442
    A bug has been filed to track resolution of the issue here, because a true fix isn't yet available:
    https://bugzilla.mozilla.org/show_bug.cgi?id=703015
    I apologize for the inconvenience.
    Regards,
    Michelle

  • Additional words added to file name

    For certain forms, when the user submits the form the file name, as expected, is the name that I gave the form. But additionally, Adobe Acrobat Pro.pdf is added after the file name. See figure. Is there a way to keep the "Adobe Acrobat Pro.pdf" from being added?
    Thanks,
    MDawn

    I have a submit button that "clicks" a hidden button. The hidden button has script that verifies that all
    required fields are filled in. Script on that button "clicks" another invisible button which opens email where
    the user selects the email recipients.
    I put the script you suggested in the PreSubmit event of the form, and then each of the Submit buttons and none of these worked.
    Thanks,
    MDawn

  • PSE6  Date listed twice in  organiser  - after rename files

    In Photoshop 6 downloader I put name and date taken in rename files - this gives me the imformation I require in Windows - My Pictures ie name and date, how can I prevent the date listing in Photoshop organiser before and after the file name?
    Is it possible in organiser to auto hide the task pane instead of having to go to window hide task pane every time?
    How can I tone down the horid dark background?
    Barry.

    What did you wind up turning off? I keep looking at the options, but I can't figure it out. The things that seem closest is the one in general about keeping the iTunes music folder organized and copying files, but I don't have either of those checked off.

Maybe you are looking for