Renaming files in a book

Hi everyone,
I need to rename files in a book, but from within the book. A Save as... won't update the cross refrences.
I see an fcode for this (FCodes.KBD_BOOKRENAMEFILE), but I've been advised not to rely on these types of shortcuts.
I don't see anything else documented in the Scripting Guide. Does anyone else have any other suggestions?
Thanks so much!
Heather A

Just following up for anybody else who might need this in the future.
My hangup was that pulling files from the book itself created Doc objects, not File objects (beginners mistake, you hate to see it). Anyway, here are some of the functions that I came up with to handle this task for anybody who needs it. Please be warned, this is quite literally my first ExtendScript project so this may not be the most efficient way to have done this (I'm always open to constructive criticism from those more experienced than myself). I know I went overkill with notes in the code, that was requested by colleagues who know less about code than I do so that if I were no longer employed for some reason another person could come in and understand exactly what the code was doing.
function fileNameReplacer(FullArray, CodeBook, BookFile) {
    /*The fileNameReplacer steps through all of the files in the book looking for those who need to be renamed.
        The function first renames all of the files, and then cycles through each file's Crossreferences and updates the
        names to reflect name changes*/
    /*Local variables are created*/
    var FileName,
        BookName,
        FilePath,
        FullName,
        FileType,
        EncodedName,
        OldName,
        NewName,
        ThisFile,
        OpenFile,
        FileArray;
    FileArray = FullArray;
    /*Loops through all of the files in the book*/
    for (var i = 0, len = FileArray.length; i < len; i++) {
        /*Tests if the file is type 255 which would signify it is a folder or a group (These will not be renamed and would throw errors)*/
        if (FileArray[i][0].type == 255) {
            /*If the file is identified as a group or folder, it is removed from the Array with the "splice" command*/
            FileArray.splice(i, 1);
            /*The counters for this loop are then adjusted to reflect the new length of the "FileArray" variable*/
            i = i - 1;
            len = len - 1;
            /*Starts the next round of the loop (which is actually repeating the same loop but without the group or folder in the Array)*/
            continue;
        /*If the file being looked at is not a folder or group, it is assigned to the "ThisFile" variable*/
        ThisFile = FileArray[i][0];
        /*Checks the file to see if it's element catalog has values. If there are no values, it would mean that there is no data from which
            to develop the encoded name, and likely means the file is something like a cover page or table of contents which do not need encoding*/
        if (ThisFile.ElementCatalog.length !== 0) {
            /*If the element catalog has items in it, the name of the current file being examined is assigned to the "FullName" variable*/
            FullName = ThisFile.Name;
            /*The FullName is then split into an array at each backslash (Backslashes in JavaScrip have their own meaning, in order to
                input a single backslash two must be used). The last item of the array is the file name which is assigned to the "FileName"
                variable using the "pop" command*/
            FileName = FullName.split("\\").pop();
            /*The FileName is then split at the period, and the file extension with a leading period is assigned to the "FileType" variable.*/
            FileType = "." + FileName.split(".").pop();
            /*The file path without file name is assigned to the "FilePath" variable. This is done by identifying where in the "FullName" variable
                the "FileName" begins, and then taking a substring of the "FullName" up to that point.*/
            FilePath = FullName.substr (0, (FullName.indexOf(FileName)));
            /*The new encoded file name is found by running the current file through the nameEncoder function along with the Abbreviation List
                (Called "CodeBook" in this function). The value produced by the nameEncoder function is assigned to the "EncodedName" variable*/
            EncodedName = nameEncoder(ThisFile, CodeBook);
            /*The encoded name and original name are then assigned to locations 2 and 1 in the File array respetively*/
            FileArray[i][2] = FilePath + EncodedName + FileType;
            FileArray[i][1] = FullName;
            /*The old name and new name are compared to see if a change has actually occurred*/
            if (FileArray[i][1] === FileArray[i][2]) {
                /*If no change has occured, the file is removed from the array using the "splice" command, since it will only slow down later processes.*/
                FileArray.splice(i, 1);
                /*The loop counters are updated to reflect the change in FileArray length*/
                i = i - 1;
                len = len - 1;
                /*Starts the next round of the loop (which is actually repeating the same loop but with the file not requiring renaming removed)*/              
                continue;
        } else {
            /*If the element catalog for the current file does not have any values it is removed from the "FileArray" using the "splice" command*/
            FileArray.splice(i, 1);
            /*The loop counters are updated to reflect the change in FileArray length*/
            i = i - 1;
            len = len - 1;
            /*Starts the next round of the loop (which is actually repeating the same loop but with the file lacking elements removed)*/
            continue;
    /*At this point the FileArray contains only files that can, and have been renamed; along with their current and new names*/
    /*Loops through all files in the FileArray*/
    for (var l = 0, lenA = FileArray.length; l < lenA; l++) {
        /*Assigns the current file, its old name, and its new name to the "ThisFile", "OldName", and "NewName" variables respectively*/
        ThisFile = FileArray[l][0];
        OldName = FileArray[l][1];
        NewName = FileArray[l][2];
        /*Opens the current file assigned to "ThisFile" as a File object. File objects allow for changes on the drive itself to be made, while
            changing the .Name attribute of a Doc object will not. This allows for the encoded names to be applied directly to the files themseves.*/
        OpenFile = File(ThisFile.Name);
        OpenFile.rename(NewName);
        /*Changes the file's label to the value of "NewName" and removes the file type (as the label does not show file type)*/
        ThisFile.Label = NewName.split(".").shift();
        /*Changes the PrintFileName value to the value of "NewName" with the file type changed to ".ps"*/
        ThisFile.PrintFileName = NewName.split(".").shift() + ".ps";
    /*Traverses all files in the books and renames the target the book is looking for. If this is not done, the book will still think the old names exist and will
        try to find them to no avail. "traverse" function sends each component in the book through another function,
          in this case the bookComponentRenamer, and supplies the second function with a parameter, FileArray here.*/
    traverse(BookFile, bookComponentRenamer, FileArray);
    xrefRenamer(FullArray, FileArray);
    /*Saves the book file with the updated component names*/
    BookFile.SimpleSave(BookFile.Name);
    /*When the book is closed, the BookFile variable will no longer function. Assigning the current books name to the "BookName" varibales will allow the book to be reopened*/
    BookName = BookFile.Name;
    /*All open files are closed*/
    closeAll();
    /*Curent book is reopened*/
    BookFile = openBook (BookName);
    /*All book files (now with updated names) are opened*/
    traverse(BookFile, openfile);
    /*Returns the updated book back to the location that originally called the fileNameReplacer function*/
    return BookFile;
function bookComponentRenamer(Component, FileArray) {
    /*The bookComponentRenamer compares the current book component with names on the FileArray (these are files that have name changes.
        If a match is found, that compent's name is changed within the book itself. This ensures that the names the book file is looking for reflect the updated file names created by this program*/
    for (var i = 0, len = FileArray.length; i < len; i++) {
        if (Component.Name === FileArray[i][1]) {
            Component.Name = FileArray[i][2];
function xrefRenamer(AllFiles, RenamedFiles) {
    var ThisFile,
        ThisXREF,
        NextXREF,
        OldName,
        NewName,
        XREFTest;
    for (var i = 0, len = AllFiles.length; i < len; i++) {
        /*Assigns the first cross reference in the current file to the "ThisXREF" variable*/
        ThisFile = AllFiles[i][0];
        ThisXREF = ThisFile.FirstXRefInDoc;
        /*Whether "ThisXREF" contains a valid cross reference (having a null value means the file has no cross references, or we have already
            looped through them all and can proceed to the next file in the FileArray)*/
        while (ThisXREF.XRefFile !== null) {
            /*Assigns the next cross reference in the file to the "NextXREF" variable*/
            NextXREF = ThisXREF.NextXRefInDoc;
            /*Loops through all of the files in the FileArray. This will let the current cross reference be compared to the files being renamed and see if
                there are any matches*/
            for (var j = 0, lenA = RenamedFiles.length; j < lenA; j++) {
                    /*Assigns the old name and the new name of the file being compared to cross references to the "OldName" and "NewName" variables respectively*/
                    OldName = RenamedFiles[j][1];
                    NewName = RenamedFiles[j][2];
                    XREFTest = ThisXREF.XRefFile.indexOf(OldName);
                    /*Tests if the current cross reference being examined links to the current comparison file*/
                    if (0 <= XREFTest) {
                        /*If yes, the cross reference is updated with the new name*/
                        ThisXREF.XRefFile = ThisXREF.XRefFile.replace(OldName, NewName);
                        /*Ends the comparison loop for this cross reference as the correct replacement has been found*/
                        break;
            /*Assigns "ThisXREF" with the value of the "NextXREF" the comparison loop starts again*/
            ThisXREF = NextXREF;
        ThisFile.SimpleSave(ThisFile.Name);

Similar Messages

  • How to rename files that appear in multiple .book files?

    I have about 50 .fm files, and 4 .book files, each of which includes about 20 of the .fm files.
    I want to rename some of the files.
    If I open all four .book files at once, and I go to First.book and rename file Q, I want it to be renamed in all the other .book files in which it happens to be included.
    How can I do that?
    Thanks.

    You have to rename the file in each book that it is included in. After the first re-name, the other books will treat the old filename as a missing one.

  • Can I Rename Tags Across all Files in a Book?

    Hi all,
    I have a question about FrameMaker 8 to which I cannot find an answer.
    Can I rename a Paragraph Tag across all files in a book? For example, I have a Paragraph Tag in each of my chapters named "SysResponse" that I want to rename to "System Response". I know that I can do this by going into each file and renaming the tag manually. However, I'm curious to know if I can do this once and apply it across all files so that the "SysResponse" tag renames to "System Response" automatically wherever it occurs.
    If this is possible, it would save so much time; I need to rename several tags (Paragraph, Character, and Table) in preparation for a template transition/clean up. I'd even be willing to do it in an alternate way, such as doing a find and replace in a .MIF file, if this is what I need to do.
    Thanks in advance for any advice!
    Chris

    Chris:
    After backing up your files lest there be a disaster:
    1. At the file level, rename one instance then use Edit > Copy Special > Paragraph Format to put the new paragraph style on the clipboard.
    2. At the book level, in Edit > Find/Change choose Paragraph Tag in the list of Find choices then type the name of the new paragraph style.
    3. In the Change list, choose By Pasting.
    Note, too, that Silicon Prairies Paragraph Tools provides a cost-effective way to perform value-added operations on a book's Paragraph tags...
    Cheers & hope this helps,
    Riley

  • Problem importing CSV or tab-delimited file into Address Book

    I am trying to import a text file (tab delimited) or csv file into address book. The files are created in Excel and consist 8 columns with address info (first name, last name, street, city etc). For the sake of simplicity, the file only contains 2 records - so all in all 3 rows with data where the first row contains the headers as described above.
    I am perfectly able to import the fields first name, last name using Address Book's text import feature. However, as soon as I try to map Address Book's address field (Home, work or other) to my text file's headers, the import wizard stops responding. I can still scroll through the records with the left and right error, but the record count is screwed up ("-3 of 2") and clicking the OK button doesn't result in anything.
    So I am able to import the names but not the addresses - so I better rename the Address Book to Name Book
    Any clue of what's going wrong?

    I've been wrestling with the exact same problem. I have come to a solution, though serendipitously. The address variables belong to a group say address Office.
    1 - I creted a column with address Office which clued in AddressBook the the existence of the data for +address Other+ (and it assigned the columns ot the proper data)
    2 - address book does have an entry of address with all group elements of same colour, normally. I reassign address other to address office
    3 - I also assign address office (in right-hand column) to address office.
    At this point I have two groups of address office
    4 - I indicate to the second group 'do not import'
    5 - Then hit OK
    It seems that this loop is necessary to instantiate the proper group name to the group of variables. Why? who knows. Bad UI? Clearly. Apple engineers should've thought about it before? no kidding...

  • Why can't I add files to a book?

    I have no idea why, but I suddenly cannot add files to a book in FM 9. I've always done it by dragging or using "Add" from the menu bar.
    Now, I go through the same motions, but nothing gets added. Anyone ever experience this?

    Huh. Turns out that because all the FM files that I was given to work with were backups, I couldn't build a book with them. So I renamed them (removed "backup") and now it's fine. I never knew backups couldn't be used.

  • Adding a new file to a book

    FM 8
    Just so you know, it's been three years since I used FrameMaker, I'm a journeyman at best. I've checked the help, it's not telling me what I need. I've inherited a project in FM, a book with, so far, 10 chapters, several appendices. I need to add a new chapter. Since it's been awhile, do I need to create the chapter before adding it to the book? Adding a file to the book gives me something FM won't open. If I select File > New > Document, it wants to know what template. I have no clue, it's probably not attached to the project and therefore unavailable. Someone else created the original, I've been hired to do updates. Guess I could copy a file, rename it, repalce the data with the new data, but it seems like that's a tad convoluted. I'd rather do it the easy (preferably correct) way.
    Assistence appreciated!
    Thanks!
    Jo Byrd

    I tried an update and it didn't work. I may have to contact the guy who set it up (he explained some of the workings in the book and the individual files to me). It's set up with a ChapNum variable, so it SHOULD (operative word!) work. But then, he's a guru and did a lot of cool things that leave this journeyman scratching her head.
    I knew all this a LOT better three years ago when I was working in FrameMaker! Too many Word docs and help files since then.
    Thanks, Arnis!
    Jo

  • Rename files or folders in Windows 8 not working

    Rename a file or folder on a Windows CE device is not working from Windows 8 when connected through Windows Mobile Device Center.
    From Windows 7 it worked just fine!
    This has been a problem for a very long time now, and im not alone according to all forums.
    But no fix as far as i can find!
    Is there anyone that have found a fix on this?

    http://answers.microsoft.com/en-us/windows/forum/windows8_1-files/windows-8-unable-to-rename-files-on-pocket-pc/abae21b7-7ee1-41c7-853e-1ac7ea5b0413
    It seems a issue in window 8.x system. Maybe you can ask for a MS support ticket. 

  • Sharepoint 2013 ItemAdded event receiver for renaming files is not working

    In SP 2013 I coded an event receiver that intercepts the ItemAdded event and it just renames the file.
    It is a synchronous event (I added <Synchronization>Synchronous</Synchronization> in the Elements.xml).
    This is the code:
            public override void ItemAdded(SPItemEventProperties properties)
                SPSecurity.RunWithElevatedPrivileges(delegate()
                    try
                        OutputDebugStringA("Inside ItemAdded");
                        string szHttpUrl = properties.WebUrl + "/" + properties.AfterUrl;
                        SPWeb openedWeb = properties.Web.Site.OpenWeb(properties.Web.ID);
                        SPFile spf = openedWeb.GetFile(szHttpUrl);
                        EventFiringEnabled = false;
                        string szUrl = properties.AfterUrl;
                        szUrl = szUrl + ".renamed";
                        string szNewFileName;
                        if (szUrl.LastIndexOf('\\') != -1) szNewFileName = szUrl.Substring(szUrl.LastIndexOf('\\') + 1);
                        else if (szUrl.LastIndexOf('/') != -1) szNewFileName = szUrl.Substring(szUrl.LastIndexOf('/') + 1);
                        else szNewFileName = szUrl;
                        if (properties.ListItem != null)
                            properties.ListItem["Title"] = szNewFileName;
                            properties.ListItem.Update();
                        spf.MoveTo(szUrl);
                        EventFiringEnabled = true;
                        base.ItemAdded(properties);
                        OutputDebugStringA("Renaming to " + szUrl);
                    catch (System.Exception exception)
                        OutputDebugStringA("ItemAdded ERROR: " + exception.ToString());
    The problem is that when I upload a .txt file using Internet Explorer, just after the renaming is done, IE says that something went wrong and when I inspect the log files I see:
    SPRequest.GetFileAndFolderProperties: UserPrincipalName=i:0).w|s-1-5-21-4050800873-4278272723-3073177257-500, AppPrincipalName= ,bstrUrl=http://sp2013/sites/demo/subsite1 ,bstrStartUrl=Shared Documents/test2.txt ,ListDocsFlags=16400 ,bThrowException=True 0fa7689c-674b-5045-c3a2-b214a5d4cbed
    01/09/2014 15:29:26.75  w3wp.exe (0x1544)                        0x16F4 SharePoint Foundation        
     General                        ai1wu Medium   System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr><nativestack></nativestack>,
    StackTrace:    at Microsoft.SharePoint.SPWeb.GetFileOrFolderProperties(String strUrl, ListDocsFlags listDocsFlags, Boolean throwException, SPBasePermissions& permMask)     at Microsoft.SharePoint.SPFile.PropertiesCore(Boolean
    throwException)     at Microsoft.SharePoint.SPFile.get_Length()     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadPage.OnSubmit(Object o, EventArgs e)     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadExPage.OnSubmit(Object
    o, EventArgs e)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessRequest(Boolean includeSta... 0fa7689c-674b-5045-c3a2-b214a5d4cbed
    ...gesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessRequest()     at System.Web.UI.Page.ProcessRequest(HttpContext context)     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)     at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)     at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext
    context, AsyncCallback cb)     at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr
    rootedObjectsPointer, IntPtr nativeRequestContex... 0fa7689c-674b-5045-c3a2-b214a5d4cbed
    ...t, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr
    pHandler, RequestNotificationStatus& notificationStatus)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr
    rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) 
     0fa7689c-674b-5045-c3a2-b214a5d4cbed
    So it is clear that the fact that I renamed the file is causing an issue in the SharePoint upload logic.
    As a solution what I did was to not declare it as Synchronous, but if I do it then there is another error when Sharepoint shows the Edit Properties dialog... in this case the upload is OK but when it is time to show that Edit Property dialog IE fails and
    says that the file has been already modified, or that "something went wrong".
    If I use a synchronous event I get one problem. If I use the asynchronous event I get another problem... It's very frustating and I am pretty sure that a so important API like Event Receivers should have support renaming files so I hope someone can tell
    me what I am doing wrong.
    Thanks in advance

    May be you want to consider using the following code and see if it works for you.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/40c78e03-2dca-4083-89d2-a7430099da68/how-do-i-change-the-name-property-of-a-file-in-a-document-library?forum=sharepointdevelopment
    Amit

  • How can I remove a deleted content file from my book's Table of Contents? I

    I deleted the file, saved the book, updated the book, updated the TOC references, and confirmed that the file has been deleted -- but it's still there in the TOC. How can I get it out of there? And at what point in the proceedings should it be gone from the TOC?

    > I deleted the file ....
    How? You need to delete-from-book using the Book menu. A right-click option on the component file name.
    > ... updated the book, ...
    A necessary step, but might not work if the remove isn't done correctly.
    > .... updated the TOC references ...
    What does that mean?
    I would expect a delete-from-book, followed by an update-book, would suffice.

  • Top-level Numbering Continuation Across Files in a Book

    My department at work is looking to transition most of our files from Word to Structured Framemaker 9 (with an eye to DITA). I am trying to build a master template for this, and running into some numbering woes. I am fairly new to FM, so I'm hoping that there is an obvious solution to this issue, and it is just my inexperience standing in the way.
    Currently, documents that we do manage in framemaker are books which contain different files:
    1. Front Matter File
    2. TOC file
    3. First subject of the document
    4. Second subject of the document
    5. Etc.
    In the template, I have created the top level style as "Chapter" and set chapter numbering to continue from previous file in the book. To me, this is the most obvious way to get FM to treat the top level (only) as continued across files. Historically, the department has just maintained seperate templates for each type of file in the book (i.e., Front Matter Template, First Subject Template, Second Subject (and beyond) Template, etc.).  Because I don't envy the thought of creating and maintaining multiple structured templates with multiple EDDs to go with them, I have consolidated the templates into one master template that contains all the styles needed for whatever part of the document we are working with.
    My issues are:
    1. My team lead would like to abolish the use of the Chapter style in our books, and instead use Heading 1 as the top level in a book. Because we will be doing a lot of importing from Word, and all of our Word docs have H1 as the top level, she does not wish to have to bump all the Headings down in order to accomodate a new Chapter level on top after we import. If this is the best way to go, then how can I tell FM to continue numbering for only H1 across files?  Can I just use the <chapnum$> variable in the Heading 1 style for numbering and get away with abolishing the use of any other chapter designation?
    2. I believe it makes the most sense to set the template to continue numbering for the chapter variable from previous file in the book, since that is the most common scenario.  Then, I can reset the first chapter in the book (manually) to start numbering at 1. Is there any compelling reason not to do this? Will this cause any issues when we go to update a book, provided that we make sure to set the numbering for that first chapter file correctly? I hear that there is a way to set numbering properties for an entire book, but I cannot seem to find this feature - only setting numbering for files within a book.
    Thanks,
    Hannah

    Hannah,
    Using a single template for structured work is a good idea. The template may get big as you add master pages, etc, but management will be much easier.
    Use the <$chapnum> building block wherever you need it, such as in autonumbering for headings, tables, figures, etc. I would set the basic numbering properties in the template for the most often used case, such as a chapter. Thus, set the chapter numbering to be from previous and the page and paragraph numbering to be start at 1, if that is what you want.
    After you create the book file and add the various books, you now have a book whose documents ALL have the same numbering. So, select chapter one IN THE BOOK FILE, right-click it and select Numbering. Set the chapter to be 1. If you want the front matter and TOC pages to be arabic, select the first such chapter, right-click and select Numbering and set the page number to be i; the chapter numbering can be anything. For pages like front matter that do not show chapter numbers, you will have to create special master pages that do not use the <$chapnum> building block. You can also set a chapter number to be text, such as Index.
    Then update your book. The main point is that you set the numbering in the book file, not individual documents. If you do not, when you update the book, FrameMaker will warn you that the numbering in the book does not match the numbering in the documents. Note this is a WARNING. When you click OK, it uses the book numbering settings in the update, NOT the settings in the individual documents. So, it is always best practice to set numbering in the book file.
    I forgot to add... I am not sure how easy it will be to convert Word files into structured FrameMaker. I never do it, but others in the forum will likely have some tips about it.
    Van

  • Is there any way to embed the pdf file in the book created in iBooks Author to make it available to be downloaded or sent to email? So that the user can print it out.

    Is there any way to embed the pdf file in the book created in iBooks Author to make it available to be downloaded or sent to email?
    I'm making the book for children and there is one chapter providing coloring pages. So I wish to attach pdf files that allow users to download it at the end of chapter so that  they can print it out. Been searching through discussion, I've found some advice about taking screen snapshot page-by-page > then send the pics from photo album to email. However, I'm wondering if there's a way that make the process easier.

    Warehouse that PDF on your own server, then link to it from your book.
    Ken

  • Automatic generation of PDF file from briefing book in OBIEE11g

    Hi all,
    Could anyone tell me if exist a way to generate PDF files from briefing books automatically in OBIEE11g?
    Thanks
    Annalisa

    I only got so far when I tried to do this in Windows. The problem comes when you try to tell the printer to print to a file with a particular name.
    The first steps are to get GhostWriter for Windows.
    Then you install the Apple LaserWriter pro 600 driver which can print to a postscript file (try it manually first). GhostWriter can then, with a command line command, using a java Process, convert that to a .pdf file.

  • Get renamed file new name

    Hello all. What I'm wanting to do is rename a file and then do some things with the new file name.
    1. I want to view the new file name with the full path
    2. I want to output the new file name with the full path to a text file or csv file
    Here is what I have for outputting the renamed file into a text file, but it isn't working:
    cls
    $resultsfile = "C:\results3.txt"
    clear-content $resultsfile
    foreach($item in gc C:\RENAME.txt){
    Rename-Item $item "1.txt" | out-file $resultsfile -append
    notepad $resultsfile
    Any thoughts on how to work with the newly renamed file name?

    Yes, sorry I forgot to mention that I'm trying to delete a bunch of files whose names are too long. So what I 'm trying to do is to rename the files first with "1.txt" and then I'm going to delete them. I just had a "forehead-slap" moment where I realized
    I could just pipe the "rename-item" into "remove-item" and that should accomplish my goals.
    But, as for my original question, if I rename a file, how can i view/use the renamed file name? Like if I renamed a file, how could I output the newly renamed file name to a text file? I tried this in my original code above, but it didn't work. Let's just
    assume that I have a single file that I want to rename to "1.txt"

  • Rename file name & format using ftp sender

    Hi all,
    This is regarding the renaming of file at sender file(FTP) communication channel and placeing the same file in the same folder.
    At FTP server at sender side (i.e.clients place) is in .txt format.But now .txt file has to rename and change into .sav foramt with below required name convention of file.
    client format is  :  SAP_Order.txt (Pervious file name).
    We need to change the file in to "SAP_Order_yyyymmddThhmmss.sav" format..
    How can i achieve this requirement?
    Can please suggests me solutions ASAP.
    Best Regards,
    satya,

    Hi,
       if your requirement is to pick the  existing file in the FTP folder...and send as idoc to the target and place the renamed file to FTP folder...
    then its simple...
    use two receivers instead of one , one for point to target and other for sender itself... (second receiver  is for  changing  the file name format....)
    Hope the above understanding is correct...if not provide more details of your requirement...
    HTH
    Rajesh

  • Deleting & renaming files - is there a shortcut to finder?

    I am a recent convert from PC to Mac. So far so good. However, one thing starts to drive me up the wall which is deleting/renaming files in programs such as photoshop, word, excel etc.etc.
    As far as I can tell, this is only possible in the finder menu. Is this Correct? I am using a lot of folders and subfolders - sometimes 3-4 levels deep. Every time I need to change/delete a file or filename - lets say while in photoshop, I have to go to finder and click my way through several levels of folders to the actual file I need to change. This is somewhat annoying and timeconsuming.
    Question 1: is there a way to do these operations in - lets say photoshop directly?
    Question 2: If not, is there a shortcut key that would point me automatically to the file in finder where I can make the changes?
    Your input would be very helpful and save me some aggravation.
    fupe

    Hi Greg,
    Thanks for your input. You are correct as far as "save" and "save as" is concerned. Windows and Mac work the same way.
    However, as far as I can tell, in Mac you can only "delete" or "rename" a file in "finder" which forces you to open up finder and locate the file in order to delete or change it.
    In windows you can do these 2 functions directly in the program (such as photoshop, excel or words). You do not have to go to "explorer or root directory" to make these changes which I believe would be the equivalent of "finder".
    In any case, Terence solved the problem. By command clicking the name (title) of the file in any program, it opens up the directory in "finder". This way makes it easy to select the file and do the changes.
    fupe

Maybe you are looking for