Renaming a SCRIPT??

hi
please tell how to rename a SCRIPT.I had developed an script,now i need to change its name,please tell how to do this.
vipin sharma

Hi Vipin,
The only way to rename is to Make a Copy of the original form and give it the new name.
Regards,
Chandra Sekhar

Similar Messages

  • Layer Renaming in script

    Hai  I  am creating a Photoshop panel using Adobe configurator4 and i want to do  buttons which have name already defined eg Silo, Retouch, Skin etc to rename both single or multiple layer which are selected . There are many script which will open its own window but i dont want that . One i got from this link its for illustrator but it runs in photoshop" https://forums.adobe.com/message/2639824   But its will rename all the layer even if its not selected or it will rename only the layers which are visible. I am not good in Scripting  . For now i have created a action script which is simple  and connected to the button in Adobe Configurator4 but it will rename only one Can you please help me

    You obviously don't know this, but if you option (alt) double click on the layer name, the Layer Properties dialog comes up, allowing you to name the layer in a modal dialog. I also find it easier to rename layers this way. A shortcut can also be set up to bring up Properties.
    The History of this was that in Photoshop 6 they made it necessary to rename layers only in the layer properties dialog. But they had too many complants, and in 7 the default went back to the way it is now - renaming using the tiny text in the layers panel-  so both methods are now available with the Option modifier.

  • [10G2 on XP PRO] Rename file script returns error

    Hi,
    I mistakenly created a "Users03" datafile without the .dbf extension.
    Now I would like to add it in order to use wildcards in scripts.
    Here is the "Rename" script:
    >
    alter tablespace users rename datafile
    'l:\oracle\product\10.2.0\oradata\oracompta\users01.dbf',
    'l:\oracle\product\10.2.0\oradata\oracompta\users02.dbf',
    'l:\oracle\product\10.2.0\oradata\oracompta\users03'
    to
    'l:\oracle\product\10.2.0\oradata\oracompta\users01.dbf',
    'l:\oracle\product\10.2.0\oradata\oracompta\users02.dbf',
    'l:\oracle\product\10.2.0\oradata\oracompta\users03.dbf'
    Here are the output from the "dba_datafiles" view and error message for the rename:
    >
    SQL> @c:\jb\data\sources\oracle\dba\datafiles
    ...[RETURN].......
    FILE_NAME TABLESPACE_NAME AUTO MAXBYTES INCREMENT_BY
    L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\EXAMPLE01.DBF EXAMPLE YES 34359721984 80
    L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\SYSAUX01.DBF SYSAUX YES 34359721984 1280
    L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\SYSTEM01.DBF SYSTEM YES 34359721984 1280
    L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\UNDOTBS01.DBF UNDOTBS1 YES 34359721984 640
    L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\UNDOTBS02.DBF UNDOTBS2 YES 629145600 12800
    L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\USERS01.DBF USERS
    L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\USERS02.DBF USERS
    L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\USERS03 USERS
    8 ligne(s) sélectionnée(s).
    SQL> @c:\jb\data\sources\oracle\dba\renamefile
    alter tablespace users rename datafile
    ERREUR à la ligne 1 :
    ORA-01525: échec du changement de noms de fichier de données
    ORA-01523: impossible de renommer le fichier de données en 'l:\oracle\product\10.2.0\oradata\oracomp
    Maybe there is some limit to the input line length in SQL*Plus?
    I can't find how to rename a datafile from the OEM console.
    Looks like I'll have to create a "usersbis" tablespace and copy every object into it, then drop users tablespace.
    Or I'll find an inocuous DBA command to test the correct syntax for referencing datafiles names under Windows.
    Many thanks for your help :-)

    Hi,
    I tried your commands after a cold backup.
    Here is the SQL*PLUS output:
    ******************** QUOTE ********************************************
    SQL> startup mount
    Instance ORACLE lancée.
    ...[RETURN].......
    Total System Global Area 272629760 bytes
    Fixed Size 1248504 bytes
    Variable Size 100664072 bytes
    Database Buffers 167772160 bytes
    Redo Buffers 2945024 bytes
    Base de données montée.
    SQL> alter tablespace users rename datafile
    2 'l:\oracle\product\10.2.0\oradata\users03'
    3 to
    4 'l:\oracle\product\10.2.0\oradata\users03.dbf';
    alter tablespace users rename datafile
    ERREUR à la ligne 1 :
    ORA-01109: base de données non ouverte
    SQL> alter database open;
    alter database open
    ERREUR à la ligne 1 :
    ORA-01157: impossible d'identifier ou de verrouiller le fichier de données 7 - voir le fichier de tr
    ORA-01110: fichier de données 7 : 'L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\USERS03'
    SQL> alter tablespace users rename datafile
    2 'l:\oracle\product\10.2.0\oradata\users03'
    3 to
    4 'l:\oracle\product\10.2.0\oradata\users03.dbf';
    alter tablespace users rename datafile
    ERREUR à la ligne 1 :
    ORA-01109: base de données non ouverte
    ********************** END QUOTE ********************************************
    I must have done something wrong.
    I'll try renaming the file from DOS and open the database.
    Many thanks for your reply.

  • Renaming SAP script forms

    Hi,
    1. Can a SAP script form be renamed?
    2. How to change the Development class attached to a form?
    Thanks.
    Pankaj

    Use program RSWBO052 for changing the development class of sapscript.
    R3TR FORM zname1
    Ankur Bhandari
    p.s Reward point if it helps.

  • Rename file script.

    I assume this is possible via scripting, but as I'm new to scripting I'm just dipping my toes in for this.
    I have a number of actions, all produce a variety of colour effects/tone. For a specific job I need to run each action one-by-one and output the result as a new PSD file using the Action's name as the filename for the PSD document.
    IE :
    FILE.PSD
    run action 'Blues to shadows'
    FILE.PSD saved to folder as 'Blues to shadows.PSD'
    does anyone have any pointers how to get to this stage?
    Thanks.

    I already wrote this a few years ago.
    http://ps-scripts.cvs.sourceforge.net/viewvc/*checkout*/ps-scripts/xtools/apps/ActionSetRu nner.js
    It should do what you want.
    -X

  • Can I rename *selected* layers with scripting?

    Hello forum,
    Let me just start off by saying I know NOTHING about Photoshop scripting.
    But I recently encountered a need to rename a whole stack of layers in a certain file, so I went Googling...
    I came across this Rename Layers script -- http://morris-photographics.com/photoshop/scripts/rename-layers.html
    However, I was specifically interested in only renaming the layers that I have got selected in the Layers panel.
    This script unfortunately renames *ALL* layers in the document.
    Is it even possible to do what I want?
    Thanks.

    Is it even possible to do what I want?
    Yes. And the simplest thing to do is ask Trevor (the author) to tweak the script for you. If he's not slammed with other work, he should be able to help you out.

  • What do you think of my Bash Script? What about the error checking?

    Well what do you think of this Bash script
    It works
    I gave it some problems (i.e. unpluged the ethernet, messed up the URL's, uninstaled some programs...) to see if would report errors and stop or just keep going... But it did
    I just kind of thought up a way to do some error checking with the commands that I know.....
    What is a better way to do error checking?
    What do you think I should add/Do to this script?
    #!/bin/bash
    # Shell script to make a USB Tumb Drive for Flashing BIOS on a Lenovo Ideapad Y510.
    # This script needs to be owned and run as ROOT with the "sudo command"
    # i.e. sudo usbbiosflasher
    # If you have anyideas send me a PM on ubuntufourms.org my user name is HunterThomson
    # Name/Rename this script usbbiosflasher and save it to the ~/home directory.
    # Then run the command- chown root:root usbbiosflasher
    # Then run the command- chmod 755 usbbiosflasher
    # Then copy the script to the directory /usr/bin.
    # Run this comand to do that- sudo cp ~/usbbiosflasher /usr/bin
    # You also must have the program "mbr" installed
    # You can install the mbr program by running this comand in the shell on Ubuntu
    # sudo apt-get install mbr
    # In Arch Linux you have to get it from Aur
    # First you will need to know a few things...
    # You will also need to know the Mount Point i.e. /media/disk and the /dev path i.e. /dev/sdb1.
    # You can find these by using the df -T comand.
    # Run df -T in the shell. Then plug in the USB Thumb Drive and run the df -T comand agin.
    # The new listing is the USB Thumb Dirve.
    # Also check to make sure the File System tipe is vFAT or FAT16 or FAT32.
    # If it is not use gparted to format it to FAT32.
    # I am farly certen that all USB Thumb drives come formated with FAT file system out of the BOX.
    # You may want to fromat it anyway just to make sure.
    echo "Interactive Shell Script to Make a USB Thumb Drive \for Flashing BIOS On a Lenovo Ideapad Y510"
    echo ""
    echo "You will need to have the program mbr installed"
    echo "If you are on Ubuntu Linux you can retreve it form the repositories"
    echo "If you are on Arch Linux you will need to get it from the Aur repository"
    echo "Open anuther shell and \do that now..."
    echo ""
    verify="n"
    while [ "$verify" != y ]
    do
    printf "Do you have mbr installed... yes or no?"
    read AN1
    echo ""
    printf "You answered... $AN1 I have installed mbr. Is this correct... y or n?"
    read verify
    done
    echo ""
    if [ "$AN1" == "no" ]
    then
    echo "Install mbr now. Then run this script agin"
    exit
    else
    echo "contunuing script"
    fi
    echo ""
    # The next comand will make a directory to put needed files into. Note this file and everything init will be owned by root.
    mkdir ~/usbbiosfiles && check1="yes"
    if [ "$check1" = "yes" ]
    then
    echo "Made directory usbbiosfiles... OK"
    else
    echo "Could not \make directory usbbiosfiles"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    exit
    fi
    # The next two comands will get the FreeDOS file and the .ROM file.
    cd ~/usbbiosfiles && checka="yes"
    if [ "$checka" = "yes" ]
    then
    echo "Changing to the usbbiosfiles directory... OK"
    else
    echo "Could not Change to the usbbiosfiles directory"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    wget "http://www.fdos.org/bootdisks/autogen/FDOEM.144.gz" && check2="yes"
    if [ "$check2" = "yes" ]
    then
    echo "Download of FreeDOS... OK"
    else
    echo "Could not Download FreeDOS"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    wget "http://ubuntuforums.org/attachment.php?attachmentid=78460&d=1216648756" && check3="yes"
    if [ "$check3" = "yes" ]
    then
    echo "Download of the BIOS.ROM \file... OK"
    else
    echo "Could not Downlad the BIOS.ROM \file"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    # The next comand will name the .ROM file to the right name.
    mv ~/usbbiosfiles/attachment.php?attachmentid=78460\&d=1216648756 ~/usbbiosfiles/06CN29WW.bios.update.tar.bz2 && check4="yes"
    if [ "$check4" = "yes" ]
    then
    echo "Renameing of the BIOS.ROM \file... OK"
    else
    echo "Could not rename the BIOS.ROM \file"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    echo ""
    # The next two comands set the variables. DEVX for the path i.e. /dev/xxx and MOUNTX for the mount point i.e. /media/xxx
    verify="n"
    while [ "$verify" != y ]
    do
    echo "You will need to know the Mount Point and the dev Path. You will also need to \make sure the File System \type is vFAT, FAT16 or FAT32."
    echo ""
    echo "With the USB Thumb Drive unpluged, Open another shell and run the comand df -T Then plug \in the USB Thumb Drive and run the comand df -T one \more time. The new device listed is the USB Thumb Drive. Note the Mount Point and The dev Path and the File system Type i.e. vFAT... If the File System \type is not vFAT, FAT16 or FAT32 you will need to fromat it with gparted. You may want to format the USB Thumb Drive anyway just to \make sure. In any \case delete all files and directorys on the USB drive before you go any ferther with this program."
    echo ""
    printf "Enter the dev path the USB Thumb Drive is at?"
    read DEVX
    echo ""
    echo "Are you sure $DEVX is the dev path of the USB Thumb Drive... y or n?"
    read verify
    done
    echo ""
    verify="n"
    while [ "$verify" != y ]
    do
    printf "What is the Mount Point of the USB Thumb Drive?"
    read MOUNTX
    echo ""
    echo "Are you sure $MOUNTX is the Mount Point of the USB Drive... y or n?"
    read verify
    done
    echo ""
    install-mbr --enable A1 --partition 1 --force --timeout 0 $DEVX && check5="yes"
    if [ "$check5" = "yes" ]
    then
    echo "Installing MBR on USB Thumb Dirve... OK"
    else
    echo "Could not install MBR on USB Thumb Drive"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    tar xjf ~/usbbiosfiles/*.tar.bz2 && check7="yes"
    if [ "$check7" = "yes" ]
    then
    echo "Unpacking BIOS.ROM file... OK"
    else
    echo "Could not unpack BIOS.ROM file"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    gunzip ~/usbbiosfiles/FDOEM.144.gz && check8="yes"
    if [ "$check8" = "yes" ]
    then
    echo "Unpacking FreeDOS files... OK"
    else
    echo "Could not unpack FreeDOS files"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    mkdir ~/usbbiosfiles/fdoem144 && check9="yes"
    if [ "$check9" = "yes" ]
    then
    echo "Made directory fdoem144 in direcoty usbbiosfiles... OK"
    echo ""
    echo "Going to \sleep \for 5secs"
    else
    echo "Could not make directory fdoem144 in usbbiosfiles directory"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    modprobe loop && sleep 5 && check0="yes"
    if [ "$check0" = "yes" ]
    then
    echo "Modprobeing loop... OK"
    else
    echo "Could not \modprobe loop"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    mount -o loop ~/usbbiosfiles/FDOEM.144 ~/usbbiosfiles/fdoem144 && check10="yes"
    if [ "$check10" = "yes" ]
    then
    echo "Mounting FreeDOS on the fdoem144 directory... OK"
    else
    echo "Could not \mount FreeDOS on the fdoem144 directory"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    cp ~/usbbiosfiles/fdoem144/* $MOUNTX && check11="yes"
    if [ "$check11" = "yes" ]
    then
    echo "Copying FreeDOS files to $MOUNTX... OK"
    else
    echo "Could not copy FreeDOS files to $MOUNTX"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    cp ~/usbbiosfiles/*.ROM $MOUNTX && check12="yes"
    if [ "$check12" = "yes" ]
    then
    echo "Copying BIOS.ROM files to $MOUNTX... OK"
    else
    echo "Could not copy BIOS.ROM files to $MOUNTX"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    sync && check13="yes"
    if [ "$check13" = "yes" ]
    then
    echo "Runing the syncing command... OK"
    else
    echo "Could not run the syncing command"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    umount ~/usbbiosfiles/fdoem144 && check14="yes"
    if [ "$check14" = "yes" ]
    then
    echo "Unmounting of FreeDOS... OK"
    else
    echo "Could not unmount FreeDOS"
    echo "Look above for errors or problems reported and fix the problem"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this script agin"
    rm -r ~/usbbiosfiles
    exit
    fi
    verify="n"
    while [ "$verify" != y ]
    do
    printf "Do you see any errors... yes or no?"
    read AN2
    echo ""
    printf "You answered... $AN2 to errors. Is this correct... y or n?"
    read verify
    done
    echo ""
    if [ "$AN2" == "yes" ]
    then
    echo "User Repoted... Error"
    echo "Look above for errors or problems reported and fix the problem"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this script agin"
    rm -r ~/usbbiosfiles
    exit
    else
    echo "Success"
    echo "I did a lot of error checking too and didnt find anything"
    echo ""
    echo "Go get a pen and paper to write down these instructions"
    printf "Then hit the Enter to continue"
    read WAIT
    echo ""
    echo "Now leave the USB Thumb Drive pluged into your computer and Reboot. When the Lenovo Logo POST screen appears hit F2 to enter the CMOS setup utility. Go over to BOOT tab and go down to HardDrive \(Not Boot Order) \then \select the USB Thumb Drive as the 1st hard drve. Then F10 and yes to save changes. Your compter will reboot agin. Then when the Lenovo Logo POST Screen appers on reboot hit F4 to enter the BIOS FLASHING program. The USB Thumb Drive will be seen as the C drive \in the list on the Left, Select it. Then \select the .ROM \file \in the list on the Right and start the BIOS FLASH. \(NOTE Your hart may stop beating... This is normal) Pray to any God you know of and your computer should restart just like normal. Hit F2 and the BIOS will now stay it is 06CN29WW. You will need to \set the boot order to the way you like it and other things \if you need to because they have been changed to the default."
    fi
    echo ""
    echo "End of script"
    Last edited by hunterthomson (2008-08-10 11:17:47)

    Personally.....  (this is just how I would have written it - if it works, then it's good enough for me though )
    I would change this whole block:
    verify="n"
    while [ "$verify" != y ]
    do
    printf "Do you have mbr installed... yes or no?"
    read AN1
    echo ""
    printf "You answered... $AN1 I have installed mbr. Is this correct... y or n?"
    read verify
    done
    echo ""
    if [ "$AN1" == "no" ]
    then
    echo "Install mbr now. Then run this script agin"
    exit
    else
    echo "contunuing script"
    fi
    To this much shorter code:
    MBR='/usr/bin/install-mbr' # Or where ever you expect it to be
    if [ ! -x $MBR ] ; then
    echo "mbr doesn't appear to be installed."
    echo "If it is installed, check it's location, make sure it's executable and then make sure the MBR variable in this script is correct"
    exit 1
    fi
    I wouldn't have used the checkXX variables for each stage:
    mkdir ~/usbbiosfiles
    if [ $? != 0 ] ; then
    #failed
    echo "Could not \make directory usbbiosfiles"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    exit 1
    else
    echo "Made directory usbbiosfiles... OK"
    fi
    There is an issue with the way you do your verifications - the user can never get out unless they answer 'y' or hit CTRL+C. Something like this gives them options:
    verify="n"
    while [ "$verify" != "y" && "$verify" != "n" ]; do
    echo "You need to answer 'y'es or 'n'o"
    read verify
    echo $verify | tr "[:upper:]" "[:lower:]" # This converts the answer to lowercase so replies entered in upper case will still work
    done
    if [ $verify != 'y' ] ; then
    exit 1
    fi
    One last thing I try to do in scripts... Declare all your binaries as variables at the start of the program, then execute the binary program by using the variable. For example:
    # Binaries
    TAR='/bin/tar'
    CP='/bin/cp'
    CHMOD='/bin/chmod'
    # Execute tar and chmod the created file
    $TAR cvzf /tmp/tarfile.tar.gz /etc/*.conf
    $CHMOD 400 /etc/*.conf
    This way, it's easy to change the path in future without having to hunt through the script if the paths change, and it also ensures you're calling the programs using the full paths to make sure you're not executing some strange variant or alias that someone has setup. If I use `chmod` 30 times in a script, and the path changes in the future or on a different system (`chmod` is a bad example cause it's highly unlikely to change, but you know what I mean), then all you need to do is update the variable at the start of the script, and it all works again without having to script-hunt and change it 30 times.

  • Batch renaming and relinking in InDesign CS4

    Is there a plug-in available for InDesign that will batch rename and relink placed images?
    In Quark, I used Badia Link Renamer which worked perfectly but it's not available for InDesign. (Was told they hope to have it incorporated into BigPicture for CS5.)
    Is there something similar currently available for InDesign?
    Essentially I need it to rename and relink files with random names to structured names such as:
    001_Cust_000123456789_art_r1.tif
    (I love that Bridge does batch renaming but then I have to manually update links in InDesign which is extremely time-consuming. I've also manually renamed/relinked files individually with Adobe Dialogue but it doesn't seem to be part of CS4.)
    Any help or suggestions would be greatly appreciated! Been looking for something for months.
    Thanks!

    Here is my last version of the script, it deals with multiple instances of the same file.
    Kasyan
    var myDoc = app.activeDocument;
    var myAllLinks = myDoc.allGraphics;
    var myMultipleLinks = new Array();
    var myLinksCounter = 1;
    var myPrepend = prompt("Example: thebook_08765", "Job description", "Please enter job description");
    if (!myPrepend) exit();
    var response = confirm("Warning: You are about to rename all images linked to the foremost Indesign Document - proceed? Keep in mind - it is not reversible!", false, "Rename Links Script");
    if ( response == true )
         WriteToFile("\r--------------------- Script started -- " + GetDate() + " ---------------------\n\n");
         for ( k = 0; k < myAllLinks.length; k++ )
              var myLinkName = myAllLinks[k].itemLink.name;
         crearLabels();
         var myPages = myDoc.pages;
         // Pages
         for ( p = 0; p < myPages.length; p++ )
              var myPageNumber = pad000(myPages[p].name);
              var myLinks = myPages[p].allGraphics;
              var myASCII = 97;
              for ( k = myLinks.length - 1; k >= 0; k-- )
                   var myLink = myLinks[k].itemLink;
                   if (myLink.extractLabel("relinked") != "yes") {
                        var myOldLinkName = myLink.name;
                        var myLinkUsage = LinkUsage( myLink );
                        var myExtension = myOldLinkName.substr(myOldLinkName.lastIndexOf( "." ));
                        if (LinkUsage(myLink) == 1)
                             var myNewLinkName = myPrepend + myPageNumber + String.fromCharCode( myASCII ) + myExtension;
                             var myOldImageHDfile = new File( myLink.filePath );
                             var myRenameResult = myOldImageHDfile.rename( myNewLinkName );
                             if (myRenameResult)     {
                                  myLink.insertLabel("relinked", "yes");
                                  myLink.relink( myOldImageHDfile );
                                  try {
                                       myLink = myLink.update();
                                  catch(err) {}
                                  myASCII++;
                                  WriteToFile(((myLinksCounter < 10) ? (" " + myLinksCounter) : myLinksCounter) + " - " + myOldImageHDfile.name + " --> " + myNewLinkName + "\n");
                                  myLinksCounter++;
                             else {
                                  if (new File(myOldImageHDfile.parent + "/" + myNewLinkName + myExtension).exists) {
                                       WriteToFile("CAN'T RENAME LINK -- " + myOldImageHDfile.name + " to " + myNewLinkName + " because the file already exists\n");
                                  else {
                                       WriteToFile("CAN'T RENAME LINK -- " + myOldImageHDfile.name + "\n");
                        else {
                             if (!IsObjInArray(myLink, myMultipleLinks)) {
                                  myMultipleLinks.push(myLink);
         var myMasterSpreads = myDoc.masterSpreads;
         // Master spreads
         for ( m = 0; m < myMasterSpreads.length; m++ )
              var myMastSpr = myMasterSpreads[m];
              var myPageNumber = myMastSpr.name;
              var myPrefix = myMastSpr.namePrefix;
              var myLinks = myMastSpr.allGraphics;
              var myASCII = 97;
              for ( n = myLinks.length - 1; n >= 0; n-- )
                   var myLink = myLinks[n].itemLink;
                   if (myLink.extractLabel("relinked") != "yes") {
                        var myOldLinkName = myLink.name;
                        var myExtension = myOldLinkName.substr(myOldLinkName.lastIndexOf( "." ));
                        if (LinkUsage(myLink) == 1)
                             var myLinkLetter = (myLinks.length == 1) ? "" : String.fromCharCode( myASCII );
                             var myNewLinkName = myPrepend + '_master_' + myPrefix + myLinkLetter + myExtension;
                             var myOldImageHDfile = new File( myLink.filePath );
                             var myRenameResult = myOldImageHDfile.rename( myNewLinkName );
                             if (myRenameResult) {
                                  myLink.insertLabel("relinked", "yes");
                                  myLink.relink( myOldImageHDfile );
                                  try {
                                       myLink.update();
                                  catch(err) {}
                                  myASCII++;
                                  WriteToFile(((myLinksCounter < 10) ? (" " + myLinksCounter) : myLinksCounter) + " - " + myOldImageHDfile.name + " --> " + myNewLinkName + "\n");
                                  myLinksCounter++;
                             else     {
                                  if (new File(myOldImageHDfile.parent + "/" + myNewLinkName + myExtension).exists) {
                                       WriteToFile("CAN'T RENAME LINK -- " + myOldImageHDfile.name + " to " + myNewLinkName + " because the file already exists\n");
                                  else {
                                       WriteToFile("CAN'T RENAME LINK -- " + myOldImageHDfile.name + "\n");
                        else
                             if (!IsObjInArray(myLink, myMultipleLinks)) {
                                  myMultipleLinks.push(myLink);
         // Multiple images
         if (myMultipleLinks.length > 0) {
              for ( a = myMultipleLinks.length - 1; a >= 0; a-- )
                   processMultiUsedLinks(myMultipleLinks[a]);
         WriteToFile("\r--------------------- Script finished -- " + GetDate() + " ---------------------\r\r");
         if (myLinksCounter == 0) {
              alert("No links have been renamed", "Rename Links Script");
         if (myLinksCounter == 1) {
              alert("One link has been renamed", "Rename Links Script");
         else if (myLinksCounter > 1) {
              alert(myLinksCounter  + " links have been renamed", "Rename Links Script");
    //--------------------------------------------- Functions ------------------------------------------------
    // Check how many times the link was placed
    function LinkUsage(myLink) {
         var myLinksNumber = 0;
              for (var c =  0; c < myDoc.links.length; c++) {
              if (myLink.filePath == myDoc.links[c].filePath) {
                   myLinksNumber += 1;
         return myLinksNumber;
    // Relink the links placed more than once
    function processMultiUsedLinks(myLink) {
         var myExtension = myLink.name.substr(myLink.name.lastIndexOf( "." ));
         var myMultiUsedLink = new Array();
         var myAllLinks = myDoc.links;
         for (var d = 0; d < myAllLinks.length; d++)  {
              if (myAllLinks[d].filePath == myLink.filePath) {
                   myMultiUsedLink.push(myAllLinks[d]);
         try {
              myLink.show();
         catch(err) {}
         var myNewLinkName = prompt ("Enter a name for this image", GetFileNameOnly(myLink.name), "This image is placed " + myMultiUsedLink .length + " times");
         if (myNewLinkName) {
              if ( myNewLinkName + myExtension != myLink.name ) {
                   var myOldImageHDfile = new File( myLink.filePath );
                   var myRenameResult = myOldImageHDfile.rename( myNewLinkName + myExtension );
                   if (myRenameResult) {
                        myLink.insertLabel("relinked", "yes");
                        myLink.relink( myOldImageHDfile );
                        try {
                             myLink = myLink.update();
                        catch(err) {}
                        WriteToFile(((myLinksCounter < 10) ? (" " + myLinksCounter) : myLinksCounter) + " - " + myOldImageHDfile.name + " --> " + myNewLinkName + "\n");
                        myLinksCounter++;
                        for (f = myMultiUsedLink.length-1; f >= 0 ; f--)
                             var myCurrLink = myMultiUsedLink[f];
                             if ( myNewLinkName + myExtension != myCurrLink.name ) {
                                  myCurrLink.insertLabel("relinked", "yes");
                                  myCurrLink.relink( myOldImageHDfile );
                                  try {
                                       myCurrLink = myLink.update();
                                  catch(err) {}
                   else     {
                        if (new File(myOldImageHDfile.parent + "/" + myNewLinkName + myExtension).exists) {
                             WriteToFile("CAN'T RENAME LINK -- " + myOldImageHDfile.name + " to " + myNewLinkName + myExtension + " because the file already exists\n");
                        else {
                             WriteToFile("CAN'T RENAME LINK -- " + myOldImageHDfile.name + "\n");
         UpdateAllOutdatedLinks();
    // Clear labels in case this script has been already run on the current document
    function crearLabels() {
         for (var f =  0; f < myDoc.links.length; f++) {
              if (myDoc.links[f].extractLabel("relinked") != "") {
                   myDoc.links[f].insertLabel("relinked", "");
    function UpdateAllOutdatedLinks() {
         for(var myCounter = myDoc.links.length-1; myCounter >= 0; myCounter--){
              var myLink = myDoc.links[myCounter];
              if (myLink.status == LinkStatus.linkOutOfDate){
                   myLink.update();
    function pad000(myNumber) {
         if (myNumber >= 1 && myNumber <= 9) {
              x =  "0" + "0" + myNumber;
         } else if (myNumber >= 10 && myNumber <= 99) {
              x = "0" + myNumber;
         } else if (myNumber >= 100 && myNumber <= 999) {
              x = myNumber;
         return x;
    function GetFileNameOnly(myFileName) {
         var myString = "";
         var myResult = myFileName.lastIndexOf(".");
         if (myResult == -1) {
              myString = myFileName;
         else {
              myString = myFileName.substr(0, myResult);
         return myString;
    function IsObjInArray(myObj, myArray) {
         for (x in myArray) {
              if (myObj.filePath == myArray[x].filePath) {
                   return true;
         return false;
    function WriteToFile(myText) {
         myFile = new File("~/Desktop/Rename Links Script.txt");
         if ( myFile.exists ) {
              myFile.open("e");
              myFile.seek(0, 2);
         else {
              myFile.open("w");
         myFile.write(myText);
         myFile.close();
    function GetDate() {
         var myDate = new Date();
         if ((myDate.getYear() - 100) < 10) {
              var myYear = "0" + new String((myDate.getYear() - 100));
         } else {
              var myYear = new String ((myDate.getYear() - 100));
         var myDateString = (myDate.getMonth() + 1) + "/" + myDate.getDate() + "/" + myYear + " " + myDate.getHours() + ":" + myDate.getMinutes() + ":" + myDate.getSeconds();
         return myDateString;

  • Running Shell scripts from the desktop

    Hi,
    I'm from the UNIX world rather than the mac one so have written a number of shell scripts. Lets call them foo.sh and bar.bash for the sake of argument.
    These are sitting in a folder on my desktop
    I can happily open a terminal session and run the scripts - and they work as I expect them to.
    If I open a Finder window and double click on the icons for the scripts what happens is that it opens TextEdit.
    Theres two things I'd like to change
    A. I'd like to change the behaviour so that the scripts run when I double clike them rather than opening an editor (possibly in a terminal window )
    B. I'd like to be able to change the editor from TextEdit to one I'm more used to...(I've installed Vim/Gvim which I quite like).
    A. - Haven't managed to get anywhere trying to solve this....
    B. - So far my attempts have got as far as...
    1...
    right-click -> open with -> Other -> select vim.app
    tick Always open as
    click open
    The file then opens in a vim window.
    however if I now close the vim application and double clike the file icon then the file opens in TextEdit again
    2...
    Right Click -> Get Info -> Open with VIM -> add -> Change all
    message appears
    'Are you sure you want to change all your Vimm.app documents to open with the application "vim.app"
    This change will apply to all Vim.app documents with extension ".sh" '
    click continue
    In the Info pane the 'Open with' selection widget immediately changes to say 'Open with: TextEdit.app'
    So I'm a bit stumped, can you help!
    Regards
    Mark
    Mac Mini   Mac OS X (10.4.3)  

    Thanks to both people who answered.
    You both gave me useful workarounds to my problem.
    Renaming the scripts to be 'foo.command' was very hepful and useful to know. I tried this and it does indeed work. I may use this in the future.
    I also had a play around with applescript and the automator to achieve similar results.
    I agree that double clicking to run the file and also edit it is mutually exlcusive - I'm sort of trying to work out how I could make it do 'either/or' as I choose. In the Windows world i'd have the option of setting 'open' to run the script (assuming I'd got cygwin installed and had assiciated it) OR 'Edit with vim' if I wanted to edit the file (assuming vim was installed!).
    Unresolved issue is that I'm still unable to get VIM to be associated with a .sh file.
    The way I would envisage it working in Mac world would be to be able to right click on foo.sh -> Open with... and have a list to select from immediately there like..
    Text Edit
    Vim
    Terminal (default)
    and be able to somehow add and remove apps from the list and change which is the default.
    My issue is that I don't seem to know how to get other apps than TextEdit to appear in the list - I suspect I need a better understanding of how these file/application associations work and are configured.
    Regards
    Mark

  • Running SQLPLUS script from command prompt on SUN

    We are making a migration from VMS to SUN ( SunOS 5.10) and from 9i to 10g. We have encountered an unanticipated problem with running scripts from the command line in SUN(SQLPLUS execution from the command line). All of our packages have a naming convention such as "DM$LOAD.PKB". I know it is a strange naming convention.
    The problem is that when the package creation script is run in SQLPLUS at the command prompt SQLPLUS can not open the file.
    SQL> @dm$load.pb
    SP2-0310: unable to open file "dm$load.pb"
    SQL> host ls
    dm$load.pkb
    SQL>
    Setting the escape character does not seem to help.
    SQL> set escape '\'
    SQL>
    SQL> @dm\$load.pb
    SP2-0310: unable to open file "dm$load.pb"
    SQL>
    Unfortunately, we can not rename the scripts. This can be done from a shell script, but our Tech Services refuse to run the SQL scripts from a shell script
    Any ideas on how to get SQLPLUS to run the scripts from the SUN command line?

    I did not notice that the cut and paste was poor. It should have read
    SQL> @dm$load.pkb
    SP2-0310: unable to open file "dm$load.pkb"
    SQL> host ls
    dm$load.pkb
    Any ideas will be greatly appreciated.

  • Get File name in script?

    Hi,
    I'm currently running a script using the sqlplus @ command. I'm wondering if there's a way, in my .sql file to know the filename that this file is.... for instance, if i do: sqlplus test/test@mydb @test.sql
    Is there a way, inside test.sql, to know that the file name is test.sql? I know it sounds stupid but it's because I'm logging the script name that was run against a database and I want to ideally be able to rename a script without needing to modify the log insertion command.
    Thanks,
    Goodie

    I do not know of anyway to know the name of the command file.
    You could add a parameter like this
    sqlplus test/test@mydb @test.sql test.sql
    Now the 2nd test.sql becomes &1 in your script and you could have code in your script that says:
    insert into log (process_name, timestamp, ...) values (&1, sysdate,...);
    To bad you can not access the command file as arguement 0 (&0).
    If you are new to parameters try this.
    Create test.sql as
    select '&1' as parm1 from dual;
    sqlplus test/test@mydb @test.sql test.sql
    Documentation:
    http://www.oracle.com/pls/db102/homepage
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14357.pdf
    Added URLs

  • SAP Script & SMARTFORM import - Prog. RSTXSCRP????

    Hi Experts,
    We hv my_SAP_Script in DEV system of FarmSeeds box.................now, I need to get(import/copy) in the same my_SAP_Script into DEV system of FarmChemicals box,
    So, in this perspective am looking the prog. of RSTXSCRP............but, it looks like its does not meets my requiremet,
    So, let me know that,
    1- If it meets my requirement, pls.let me know How to do it, I mean, Is I need to IMPORT to a .txt file on my local desktop?
    2 - How to get it from DEV of one box to DEV of another box?
    3 - The same case for SAMRTFORM also!
    replies appreciated
    thanq
    Edited by: SAP ABAPer on Nov 6, 2008 7:05 PM
    Moved to correct forum by moderators
    Edited by: Matt on Nov 6, 2008 8:12 PM

    thanq.
    for SMARTFORMS also, I did the same, so, looks like its working.
    but, clarify,
    1 - shuld i check the check box of BINARY FORMAT?
    2 - In the Target system, system is forcing me to give/specify the SAME NAME, wht we hv in SOURCE system...........say, my_sap_script??? so, is it so? or Can I give any name? bcoz, here at thisa client need to follow naming conventions?
    2 - looks like, i can NOT RENAME the sap script? is it correct or is it possible to RENAME the script, if so, how?
    3- pls. clarify ur statement below,
    " You will have to use a transport for the SmartForms anyway"
    thaq
    Edited by: SAP ABAPer on Nov 6, 2008 8:08 PM

  • Mountain Lion, Mail, Run Scripts

    How do you run an Applescript in a mail rule in ML?
    When selecting Run Applescript, the dialog to the right says "No script installed". Clicking on it only has option "open in finder" and selecting it simply opens a finder window. However, you can not select the script, you can only open a script which is weird. Any ideas?

    See this from Mail Help:
    Choose Mail > Preferences, and then click Rules.
    Add a rule or select an existing rule to edit.Create or edit conditions as necessary.
    From the “Perform the following actions” pop-up menu, choose Run AppleScript.
    Choose a script from the pop-up menu of scripts that are located in ~/Library/Application Scripts/com.apple.mail. Or choose “Open in Finder” to open the folder so you can copy a script into it.If you later move or rename the script, your rule will not work.
    Click OK to save the rule.

  • Save a script or copy a script with SQL Script  editor

    Hello,
    I try to rename a script in the script repository I've loaded using the upload command.
    I enter the new script name in the text field and save with the new name as the pdf doc explain (page 18-8).
    It does not create any new script in the repository.
    Also when i make a change and save it does not save the modification and the last modification date remains the upload date.
    Can you help me ?
    Thx.
    Jean-Paul

    Scott,
    Thx for your help. I use Application Express 3.1.0.00.32 and the document I refer is Application Express User’s Guide Release 3.1 E10499-01 chapter 18 page 18-8 "Copying a script".
    What I do is the following :
    1) upload a file name pks_test with encoding scheme 'Western European ISO-8869-1' (to preserve accentuation characters used in the french language)
    2) Edit it then modify it in the editor then save it.
    3) The re-open it : the modification made at previous step has disapeared !
    4) Change the name from pks_test to test_pks and the name is not changed.
    Also the 'Last Updated' info is updated as if there were no change since the
    script creation time.
    If i do the same steps with the Hosted version of APEX (thx to Oracle) all work
    fine.
    There is a difference between the 2 environment :
    my local (in France) display text in english (Home/Application Builder/SQL workshop ...)
    the hosted (somewhere in the world) display text in french (Page d'accueil/Application Builder/SQL workshop ...)
    Thx for the help

  • How do I install and apple script in mail

    I am using  dreamhost as my ISP. I am  getting killed with spam and the have a  script. I found out how to add  the script via the rules function, but,  how do you store the script in  the location you need to retreive it  from. there I can't find info. Can  someone give me steps please? Do you  make a text file, etc?

    Select Mail Help from Mail's Help menu. Search for "install apple script."
    Use scripts as rule actions
    You can attach a script to a Mail rule. For example, you could have an incoming message trigger a script that copies information from the message and pastes it into a database that works with AppleScript.
    Open Mail
    Choose Mail > Preferences, then click Rules.
    Add a rule or select an existing rule to edit.
    Choose Run AppleScript from the “Perform the following actions” pop-up menu.
    Choose a script from the pop-up menu of scripts that are located in ~/Library/Application Scripts/com.apple.mail. Or choose “Open in Finder” to open the folder so you can copy a script into it.If you later move or rename the script, your rule will not work.
    Click OK to save the rule.
    If you used scripts in Mail rules in OS X Lion or earlier, then the first time you open Mail in OS X Mountain Lion or later, your scripts are moved to ~/Library/Application Scripts/com.apple.mail, and your rules are updated with the new location. To show your home Library folder, hold down the Option key, then in Finder choose Go > Library.
    If you use iCloud Documents & Data, your rules are available on your other Mac computers (with OS X 10.8 or later) that have iCloud Documents & Data turned on. Scripts attached to rules aren’t available.

Maybe you are looking for