Rename the current active file?

I'm wanting a script to be able to rename open Photoshop files, if possible.
I cobbled this together from an existing script:
tell application "Adobe Photoshop CS5"
  activate
          set old_name to name of current document
          set dialog_result to display dialog ¬
                    "Rename active document:" default answer (old_name) ¬
                    buttons {"Cancel", "Rename"} default button 2 ¬
  with icon note
          if button returned of dialog_result = "Rename" then
                    set new_name to text returned of dialog_result
                    set d to properties of current document
                    if path of d is equal to missing value then
                              set name of current document to new_name
                    else
                              tell me to set the_file to POSIX file (d's path as text) as alias
                              tell application "Finder"
                                        set name of the_file to new_name
                              end tell
                    end if
          end if
end tell
If I run it it shows the dialogue window, but when I enter the new name and hit Return it throws out lots of errors.
Is something like this possible?

As Chris wrote Photoshop is not a File Editor. Photoshop edits Photoshop Documents the current Document may or may not have a file on the system created fron the active document.  If if does have a file assocatation I sure with scripting you can perform file operations on the file  like delete, rename, move etc.  However the will not change the active document name. Basicly document name is read only.... well sort of read only for if the current document does not have a file assocation and you save it into you file system The docoument becomes assocated with a file and Photoshop will change the active document name.  Aslo when you open a RAW file through ACR the inage image window or tab may show something like imagename.cr2 there is not actually a file associated with the document for Photoshop can not save a Camera RAW file so if you save it as PSD or TiFF the window or tab will now show the file assocation imagename.psd|tif  not .cr2. The document name does not always change with a save for if you save the PSD as a jpeg after the jpeg images is saved the document reverts back to its layered and color depth state  and is still imagename.psd.  There is no active document associated with that saved jpeg file. You can open it and have two document open that look the same one being layered a and perhaps 16bit and the other flat and 8bit.

Similar Messages

  • How to not append '.PART' to the file name of the currently downloading file, and just download the file with its normal filename

    In Windows, when Firefox (I'm currently using 7.0) downloads a file, it appends ''.PART'' to the file name of the currently downloading file and just renames it to its original file name after it finishes downloading.
    I sometimes like to watch a currently downloading video file, so it will be better if Firefox just downloads the file to its actual filename (like what Opera does), so I can easily double click the incompletely downloaded file and watch it with the video player assigned to that file extension, rather than the awkward ''Right click -> Open With -> Choose Default Program'' route with .part files.
    Does anyone know how to set Firefox to do this?

    It is possible that your anti-virus software is corrupting the downloaded files or otherwise interfering with downloading files by Firefox and prevents Firefox from renaming the .part file.
    Try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.
    See "Disable virus scanning in Firefox preferences - Windows"
    * http://kb.mozillazine.org/Unable_to_save_or_download_files

  • I bought a new laptop (Macbook) but the current installation files I have of Photoshop Elements 12 is for Windows, how can I change this? Or do I have to purchase an all new photoshopset?

    Can anyone help me with this question?
    I bought a new laptop (Macbook) but the current installation files I have of Photoshop Elements 12 is for Windows, how can I change this? Or do I have to purchase an all new photoshopset? I hope not because that would be really expensive.

    Really? That's extremely unusual. Have you looked at all the discs? In any case you can download the mac version here:
    Download Photoshop Elements products | 12, 11, 10

  • How to get the current executing file/itself absolute directory?

    hellooo,
              gentlemen/lady, how to get the current executing file/itself absolute directory?
              thanks
              

              Hello,
              you can get the real path information of the JSP through the servlet context:
              http://java.sun.com/products/servlet/2.2/javadoc/index.html
              javax.servlet
              Interface ServletContext
              Method getRealPath
              Christian Plenagl
              Developer Relations Engineer
              BEA Support
              [email protected] (alex mok) wrote:
              >hellooo,
              >
              >gentlemen/lady, how to get the current executing file/itself absolute
              >directory?
              >
              >thanks
              

  • Suggestions to find the current active fields in debugging mode

    Hi All,
    I need to validate a particular entry in the screen in a particular subroutine(inside a user exit). I know the field gets populated but do not know which field is that, is there a way to know the current active fields in the debugging mode.
    Regards,
    Karthik

    Hi,
      You can create dynamic types and data for those types are run time.
      lets assume that you have structure of some type and you have work area of that type.
    DATA: lv_data type SPFLI.
    DATA: lr_rtti_struc TYPE REF TO cl_abap_structdescr.
    DATA: lt_comp       TYPE cl_abap_structdescr=>component_table.
    DATA: ls_comp       LIKE LINE OF lt_comp.
    DATA: lr_data       TYPE REF TO data.
    FIELD-SYMBOLS: <fs_data> TYPE ANY.
        lr_rtti_struc ?= cl_abap_structdescr=>describe_by_data( lv_data ).
        lt_comp = lr_rtti_struc->get_components( ).
    "Now  lets remove two fileds from the table as follows.
    LOOP AT lt_comp into ls_comp.
    DELETE lt_comp INDEX sy-tabix.
    IF sy-tabix = 2.
    EXIT. " Delete two components of the structure now lt_comp as two components less from SPFLI
    ENDIF.
    ENDLOOP.
        CALL METHOD cl_abap_structdescr=>create
          EXPORTING
            p_components = lt_comp
            p_strict     = abap_false
          RECEIVING
            p_result     = lr_rtti_struc.
    CREATE DATA lr_data TYPE HANDLE lr_rtti_struc. "Now you have data of the new type
        ASSIGN lr_data->* TO <fs_data>.
        CREATE DATA lr_table LIKE STANDARD TABLE OF <fs_data>.
        ASSIGN lr_table->* TO <fs_table>.
    Regards,
    Sesh

  • Restart current song while iTunes is not the current active app

    In prior iTunes 11 / Mtn. Lion when using an Apple keyboard the F7 key when pressed would re-start a song that was playing with one press, and go to the previous with 2. This functionality has changed so that now it will go to the previous track with one press.
    Is there a way to change the functionaly back or, add a separate key command that allows me to restart the current song when iTunes is not the currently active app?
    Thanks!

    I have a SteelSeries Shift keyboard, and experienced the same problem after updating to 10.4.
    Found this little piece of software to fix the problem for me:
    http://code.google.com/p/hktunes/
    It's not ideal, as it has to run in the system tray in order to work, but it's way better than being without the functionality of the hotkeys, untill the problem is fixed.
    Hope this works for you guys as well!

  • How can I automatically have a new tab always be a copy of the current active tab?

    The add-on extension "NewTabURL" (by "sogame") provided the option I want and used for a number of years. But it stopped working when Firefox was updated to version 16.0. When I click for a new tab, all I get is a completely blank tab. How can I automatically have the new tab always be a copy of the current active tab?
    Can the extension "NewTabURL" be revised to work in version 16 and/or version 17? If not, how else can I get the new tab functionality that I desire? I can't seem to find any other extension that provides that functionality.
    Milt Beychok

    My trackball has 4 buttons and a scroll wheel. Each of the 4 buttons is programmable. The 4 buttons are normally pre-programmed for single-click, double-click, drag and right-click by simply pressing on them
    Each of the 4 buttons may be programmed to also have other functions. For example, I programmed "control/single-click" to produce a middle click. I could also have used "shift/single-click" or "alt/single-click" to produce the middle-click. Or I could have similarly programmed double-click or drag or right-click. The Kensington Expert Mouse is quite versatile ... once you get the hang of programming it.
    I have had it for about 4 years and I had never had the need to program one of them until you told me about using a middle-click.
    Milt Beychok

  • After the currently active tab is closed, can the previously acitve tab be automatically displayed?

    After the currently active tab is closed, I don't want to see the tab on its right or on its left. I want to see the tab that was active before the closed one, whatever its position is on the tab strip.
    Can that be achieved?

    My trackball has 4 buttons and a scroll wheel. Each of the 4 buttons is programmable. The 4 buttons are normally pre-programmed for single-click, double-click, drag and right-click by simply pressing on them
    Each of the 4 buttons may be programmed to also have other functions. For example, I programmed "control/single-click" to produce a middle click. I could also have used "shift/single-click" or "alt/single-click" to produce the middle-click. Or I could have similarly programmed double-click or drag or right-click. The Kensington Expert Mouse is quite versatile ... once you get the hang of programming it.
    I have had it for about 4 years and I had never had the need to program one of them until you told me about using a middle-click.
    Milt Beychok

  • JavaScript:  How do you pass the currently active doc to a dialog in a menu item?

    I'm using Adobe Acrobat 11.0 Standard on Windows 7, and I'm having trouble with the menu item that I'm creating.  The menu item calls a dialog that prompts the user to select a page in the currently active document.  The problem is, I can't figure out how to pass the currently active document to the dialog.  I scoured the rest of the documentation, did searches on Google and here in the Adobe forums, but haven't turned anything up.  The AcroJS API gives the following solution (found under app/methods/execDialog):
    This function attaches the Doc object to the dialog box, then passes the dialog box to the app.execDialog method. The dialog4 object and this function can be at the document level.
       function dotheDialog(dialog,doc)
            dialog.doc = doc;
            var retn = app.execDialog( dialog )
    Finally, the following script can be executed from a mouse-up action, for example.
        dotheDialog( dialog4, this );
    I did this exact thing, but in the dialog, the value of this.numPages still comes out as undefined, indicating that the current document still hasn't been passed.  My own code looks like this:
      function dotheDialog(dialog, thisDoc){
        dialog.doc = thisDoc;
        var retn = app.execDialog(dialog);
      app.addMenuItem({
        cName: "Test Dialogue Box",
        cParent: "Edit",
        cExec: "dotheDialog(templateDialogue, this);"
    where templateDialogue is the name of my own dialog, rather than dialog4.  I'm not sure what the retn variable that they declare in the documentation is for, but I've tried it with and without that part, and it doesn't seem to make a difference.  Does anyone know how to do this?

    Sorry, here it is.  It's also just a small modification of something directly from the API, which is why it still has the date bit in it.
    var templateDialogue = {
      initialize: function (dialog) {
        // Create a static text containing the current date.
        var todayDate = dialog.store()["date"];
        todayDate = "Date: " + util.printd("mmmm dd, yyyy", new Date());
        dialog.load({ "date": todayDate });
      commit:function (dialog) {    // called when OK pressed
        var results = dialog.store();
        var inBounds = (parseInt(results["tPag"]) < this.numPages);
        if(!inBounds){
          app.alert({
            cMsg: "Please enter a valid number for the page from which to make the template." +
            "\n" + parseInt(results['tPag']) + " = parseInt(results['tPag']) !< this.numPages = " +  // I put this in to see the value of this.numPages,
            this.numPages,                                                                           // and it continues to be undefined.
            cTitle: "Page out of Bounds",
            nIcon: 0, nType: 0
        }else{
          var nButton = app.alert({
            cMsg: "Your template is named " + results["tNam"] + " and is made from page " + results["tPag"],
            cTitle: "javascript",
            nIcon: 3, cType: 0
      description:    {
        name: "Personal Data",    // Dialog box title
        align_children: "align_left",
        width: 350,
        height: 200,
        elements:
            type: "cluster",
            name: "Add a page to this documents templates.",
            align_children: "align_left",
            elements:
                type: "view",
                align_children: "align_row",
                elements:
                    type: "static_text",
                    name: "Template Name: "
                    item_id: "tNam",
                    type: "edit_text",
                    alignment: "align_fill",
                    width: 300,
                    height: 20
                type: "view",
                align_children: "align_row",
                elements:
                    type: "static_text",
                    name: "Generating Page: "
                    item_id: "tPag",
                    type: "edit_text",
                    alignment: "align_fill",
                    width: 300,
                    height: 20
                type: "static_text",
                name: "Date: ",
                char_width: 25,
                item_id: "date"
            alignment: "align_right",
            type: "ok_cancel",
            ok_name: "Ok",
            cancel_name: "Cancel"
    Side Question:  Out of curiosity, how would you abort if the user clicks cancel?  I get the feeling that they don't cover it because it's something you're supposed to already know how to do, but...I don't.  Would you just put whatever action you want to take into an if ( button == "Ok" ) type statement so that cancel does nothing?

  • Script to find the currently active sql

    hey,
    Can somebody post me a script to find the currently active sql in the database ???

    Hi,
    You can try these below:
    select s.username
           c1,t.sql_text
    from v$session s, v$sqltext t
    where
    s.sql_address = t.address and
    s.sql_hash_value = t.hash_value and
    s.username is not null
    order by s.username,s.prev_sql_addr,s.prev_hash_value,t.piece;
    or
    select sesion.sid,
           sesion.serial#,
           sesion.username,
           sesion.sql_id,
           sesion.sql_child_number,
           optimizer_mode,
           hash_value,
           address,
           sql_text
      from v$sqlarea sqlarea, v$session sesion
    where sesion.sql_hash_value = sqlarea.hash_value
       and sesion.sql_address    = sqlarea.address
       and sesion.username is not nullCheers

  • File system task - Move file issue, skip the current log file thats open by another process - IIS logs

    Hi,
    I have created a package to move IIS log files from their source directory to another directory called processing. However, when the package tries to move the current log file it errors because the file is in use by another process (by IIS as its still writing
    to it). I would like the package to just ignore the "in-use" file and process the rest and show the package completing successfully. The file in use will be rolled by IIS at midnight and the file will be picked up by the next package run.
    However, when the file is rolled and becomes free a new log file is created which will be marked as "in-use"...... which should be ignored at the next run.
    Is there some way that I can tell the file system task to ignore in use files or add an event handler to do the same sort of thing?
    Any assistance is appreciated

    Hi Arthur,
    Thank you for your reply.
    I have resolved the issue with the following example:
    http://www.timmitchell.net/post/2010/08/23/ssis-conditional-file-processing-in-a-foreach-loop/
    What I realised was that I needed to just ignore the current log file which gets created daily, so using the above example (and changing the last written date to created date) I am able to ignore/skip the log thats in use.
    Adam

  • How to get the filename of the current active document in InDesign CS4?

    Hi,
    If I open a document from File->Open, I can get the document's file name using IOpenedFileInfo->GetOpenedFilePath().
    But, if I create a new document and perform File->SaveAs, GetOpenedFilePath is returning invalid IDFile reference.
    What is the right way to get the active document's file name?
    Thanks,
    VSP

    You can try this:
         IDatabse * db = ::GetDatabase(theDoc);
         IDFile *  sysFile = db->GetSysFile();
         PMString docName = sysFile->GetFileName();
    Good luck

  • Get the current active monitor handle in multi monitor environment

    Hi,
    I have a requirement to get the HMONITOR handle of the active monitor in multi monitor environment.
    i.e; Get the HMONITOR of the currently selected monitor
    Thanks in advance

    Hi Chris Lewis,
    Thanks for quick reply.
    I'm referring to the monitor, where a window is invoked
    I want to identify from which monitor, my window was invoked, so that I can create and  show the window in that monitor.
    I had already tried using MonitorFromWindow(). But it always give primary monitor handle.
    My Code:
    HMONITOR hMonitor = ::MonitorFromWindow(myMainFrame->GetSafeHwnd(), MONITOR_DEFAULTTONEAREST);
    hMonitor always refers to Primary monitor, though window is invoked from Secondary monitor.
    Thanks in advance

  • Adding parts of the Current [PS] File to a CS Live Review

    I have a large psd, say 4000 x 8000 pixels in size; I can only up;load a snapshot of the entire file when I want to upload a portion of the file as a new part of the current review; any suggestions?
    tia,
    --Dan

    Flatten the file, crop the area you want and then upload? Then undo the cropping and flattening to revert to your layered version.

  • Display the Current Running Files in the Label Control

    I have a label control in Windows Form Application, and i have the application to display the building and progress of the projects in the label control using C# code. Along with the update of the label, the progress bar should also show progress simultaneously,
    according to the building of the project. How should i do this ??
    Thanks.
    Tanmay

    Hello All;
    I want to know how can i display the current running project in the label control along side the same, i want to  display the progress of the files that are build successfully through a progress bar.
    What i need to do is when i click the button named as "Build" in the GUI it will display the selected projects to build from the CheckedListbox into the label control placed in the GUI.
    Please, provide me some hint regarding the same.
    Thanks.
    Tanmay
    Hello,
    It depends on what your application is and how you build these files, if possible you could share them with us.
    The most common way to display the progress, is to set the text for that label before or after we execute the line building these files.
    You could place the lines setting the text or change the progressbar.value before or after the building lines.
    Here is a simple sample using progressbar with a backgroundworker.
    http://stackoverflow.com/questions/12126889/how-to-use-winforms-progress-bar
    Regards,
    Carl 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • I downloaded firefox 3.6.9 but it will not open, says it's corrupted.

    Pretty simple, little icon kept popping up urging me to download the newest version of firefox, I tried twice with the same result. It seems to download just fine, but when I go to run the program it says it's corrupted and won't allow me to continue

  • How can I move move my iphoto Library

    Does anyone know how to move and redirect photos from one drive to another. My photos keep downloading to my hard drive which is quickly running out of space so I have added a new internal storage disk to my G4. It doesn't seem as if there is a way t

  • Adobe Acrobat 9 PDF Writer replaces default printer

    I have tried to look this up but no one seems to have a definitive answer for this problem. First let me explain my organization's set-up and what the problem is. I work for a high school with several PC's running a mix of Windows 7 and Windows XP in

  • Xy graph axis number font sizes.

    sorry see my earlier xy graph axis font post for the details but what I really want to do is change the size of the font. thanks.

  • After effects 13.2 update corrupt all adobe products

    After my software updated I can no longer open any adobe cc product. I have uninstalled, deleted temp files, preference files, and run cc cleaner. I have disabled all firewalls and still cannot get it to open. I hangs at mediacore the turns black. I