Renaming and copying files (Bridge CS3)

Hi -- Scripting bridge, I am able to copy files using the copyTo(target) function.
I also can rename files using the Javascript file.rename() function.
But I am having trouble doing both in concert.
If I rename before I copy, I lose the reference to the selected thumb, and I cannot copy it.
I have tried using the Javascript file.copy() function with no success.
Does anyone have any suggestions how I can approach this problem?
thanks in advance

Don't you just need to cancat the folder that you have as target and the thumbs name in a new file object?
#target bridge
var thisFolder = Folder.desktop;
var thisFile = app.document.selections[0];
if (thisFile.type == 'file') {
     if (thisFile.copyTo(thisFolder)) {
          var newFile = File(thisFolder.fsName + '/' + thisFile.name);
          newFile.rename('SomeNewName');

Similar Messages

  • How to rename and copy files in DMS module

    Hi all,
    I'm new to DMS, In trans cv01/2n (on save) -  I need to rename a file  and make a backup and place it in another directory.
    should i use function modules ? can i do it directly ?
    thanks
    ziv.

    Ziv
    Please elaborate more. Your question is not clear.
    Regards
    Amaresh Makal

  • Renaming and copying file in scriptask

    Hi All,
    I have created a package in which once the process is over , i want to add today's date to my source file and move it to another folder.
    suppose my source file is Test.xls. i want to change the name of my file to FilePolling.20150224.Test.xls

    Open up your System File Task and go to the expressions tab. Press the elipsis button, select Destination as the property, and use:
    "c:\\myFolder\\FilePolling."+(DT_WSTR, 4) DATEPART("year",GETDATE())+RIGHT("00"+(DT_WSTR, 4) DATEPART("month",GETDATE()),2)+RIGHT("00"+(DT_WSTR, 4) DATEPART("day",GETDATE()),2)+".xls"
    as your value, replacing c:\\myFolder\\ with your actual path. Remember not to use mapped drives, instead use the actual UNC path.

  • Upload and Copy files using PLSQL.

    Hi All,
    Can UTL package can be used to upload any local data file to server?
    Or is there any in-built package which can be used to upload files to servers and copy files to another directory?
    Thanks in advance.

    Avishek wrote:
    Thanks.
    But i've a requirement to upload and copy files from one directory to another.
    How can i approach?Realize we only know what you post & so far you have posted NOTHING useful.
    How exactly does end user interact with the DB?
    3-tier application?
    EndUser<=>browser<=>WebServer<=>ApplicationServer<=>DatabaseServer
    What OS name & version for client system?
    Handle:      Avishek
    Email:      [email protected]
    Status Level:      Newbie (5)
    Registered:      Jun 3, 2008
    Total Posts:      68
    Total Questions:      27 (16 unresolved)

  • Using foreach loop container with file system task to rename and move files

    the foreach loop container will not rename and move files for me
    sukai

    duplicate of
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/8f2899f1-43b0-47e0-8bd0-e082989cdcb8/file-system-task-and-foreach-loop-container?forum=sqlintegrationservices
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Aborting index build. Too many errors with finding and copying files ...

    Hi dears,
    I'm using UCM 11g.
    I'm trying to start the automatic update cycle. When i start it, it gives me an error message just like :
    Indexing aborted at :<time>. Aborting index build. Too many errors with finding and copying files to the appropriate place.+
    Can anybody help me about this problem?
    Helps will be appreciated.
    Erdo
    Edited by: erdo on 28.Mar.2013 11:11

    Read this: error in Collection Rebuild Cycle
    and maybe also UCM Indexer - Collection Rebuild Cycle errorring out

  • I want to rename and copy one file by developer

    i want from u please to help me in this problem,i want to rename one file in hard disk using forms 6i
    i used this command
    host('ren c:\xxxxxx_myfile1.txt yyyyyy_myfile2.txt ,no_screen);
    there is one problem face me when the length of name of file is more than 8 charchater ,i can not to rename file ,new name stop in 8 charcahter onle ,and when i copy file using forms 6i and length of the name of file is more than
    8 charcater copy process is failure ,i use this command
    host('copy c:\xxxxxx_myfile1.txt c:\newfolder\yyyyyy_myfile2.txt ,no_screen);

    Did you try enclosing the filenames with " ?
    Like:
    host('copy "c:\xxxxxx_myfile1.txt" "c:\newfolder\yyyyyy_myfile2.txt" ' ,no_screen);

  • Moving and copying files in Bridge v4.0.4.2

    CS5 Bridge crashes whenenver I try to move or copy files. It doesn't matter if I drag&drop or use copy/paste.
    I have tried to correct using advice from a previous query made a couple of years ago but it does not improve the situation.
    I am using Windows 7 with bags of memory.
    DaveOR

    DaveOR2 wrote:
    Unfortunately I don't have sufficient understanding of computers to carry out your detailed suggestions - although I have tried.
    Mainly I don't know where to find the various things mentioned.
    eg how do I do a ful system integrity check?
    Perhaps I need to take the whole shebang to the shop and see if they can sort it out.
    I can say that I have a fairly extensive range of software on the machine and it is only Bridge which is giving me trouble.
    It would help if we had a better idea of what drives/volumes you have on your computer, and how they are connected. For example: do you have any external hard drives? Do you have any network drives? Are your SATA drivers up-to-date?
    It's fairly straightforward to check your disk integrity: open Windows Explorer, click Computer, and right click a drive, selecting Properties from the bottom of the list; on the Tools tab, click Check Now, then Start. Do this for every drive.
    Try disconnecting your computer from the network and disabling your anti-virus software to see if that is causing your problem.
    It is always worth updating graphics drivers, although it sound unlikely this is your problem. Maybe your system has driver update software?
    You could ask the shop to help, but it might be wise to narrow down the problem first, or they could potentially spend hours looking at it.
    The Event Viewer might be a good place to look too, look for red and yellow warnings in the Windows System and Application logs. Find Event Viewer by typing it into Start menu Search box.

  • I need to batch rename and relink files in indesign

    I have a whole bunch of files that I need to rename ( I need to add a prefix on to the front eg. a whole group of files called "plan.jpg" 01.jpg, 02.jpg, etc... need to now read ORD_plan.jpg, ORD_01.jpg, etc...) I can batch rename the files in adobe bridge, but I have to go in one by one and re-connect the links. Is there a script which can batch rename and relink all the files? 
    Thanks!

    This biterscripting script may possibly help. It takes two input arguments.
    directory - directory under which the .jpg files are located
    prefix - prefix which will be added to each file's name
    # Script RenameJpg.txt
    var str directory, prefix, list, filepath, name
    cd $directory
    find -n "*.jpg" > $list
    while ($list <> "")
    do
        lex "1" $list > $filepath ; stex -p "^/^l[" $filepath > $name
        set $name = $prefix+$name
        system copy ("\""+$filepath+"\"") ("\""+$name+"\"")
    done
    This is the way you would use it - copy and paste the script code into file C:/Scripts/RenameJpg.txt, then enter this command into biterscripting.
    script "C:/Scripts/RenameJpg.txt" directory("C:/test") prefix("ORD_")
    It will rename C:/test/plan.jpg to C:/test/ORD_plan.jpg, C:/test/01.jpg to C:/test/ORD_01.jpg, etc.
    Important: I am using the 'system copy' command so that files are copied instead of renamed. Once you are happy with the test, you can change that command to 'system rename'.
    Also, if the .jpg files are within subfolders of C:/test, change the 'find -n' to 'find -r -n'. -r means recursive = search in subfolders. Syntax for the find command at http://www.biterscripting.com/helppages/lf.html
    Message was edited by: Peter Spier to change 'path' to 'filepath' per post below
    Message was edited by: Peter Spier to change "perfix to "prefix"

  • Batch Rename and now files will not open

    i hope someone can help me. i moved some .dng files from an external drive to my mapbook pro using batch rename in bridge CS5. The files moved to my desktop ine, but now they will not open. When I try to open them  the digital convertor opens up. When I try to open them in photoshop it says it is a unrecognized format. They were fine ten minutes ago in bridge. does anyone have anything they can have me try? I am depserate to get these images printed up tonight and I don't have time to edit them again.

    You probably forgot to include the extension .dng or renamed with an extra dot (.) in the filename. Be surr to have only 1 dot with the three letter extension dng at the end (. dng)
    You can use Bridge for that again to rename and use the dng extension

  • IView Media Pro erases adjustments and ratings in Bridge CS3 and Camera RAW 4.2

    OUCH! I seem to have lost about a day's worth of work. I rated and adjusted my Canon cr2 RAW files using Bridge CS3 and ACR 4.2. Then I used iView Media Pro 3.1.3 to add keywords. When I opened the files back up in Bridge CS3, my ratings and adjustements were gone. Actually, when I open the sidecar files in a text editor, I can see the adjustments, but ACR and Bridge can't read them. Anyone else seeing this? If so, how do you fix it or work around it???
    Edward McCain
    Tucson, AZ

    Have you tried purge cache for folder?
    iView Media Pro is now Expression Media 1, maybe this 'upgrade' works for you.
    You know that you can add keywords and sets in Bridge as well?

  • Help! Error 36 When I try and copy files to my external drive

    Yesterday morning I discovered that I can't copy files from my desktop to my external hard-drive. The last time I performed this action was Saturday afternoon were all worked as normal, and to the best of my knowledge I've changed nothing on my system since then.
    When I try to drag a file from the desktop to a folder on the external drive I get the message
    The Finder can’t complete the operation because some data in “X” can’t be read or written. (Error code -36)
    The external drive is the drive I use for my iTunes music files, and I've discovered this morning that I cannot import a CD to iTunes, however I can burn a playlist from iTunes to a CDr.
    I'm using an iMac, and the external drive is a Western Digital 1TB (Journaled HFS+) connected via firewire.
    I've seen references to similar issues through Google searches, but no definitive answer, can anyone help?

    I/O error -36 bummers!
    It could mean that there are bad blocks on the disk. Backup everything on that external disk now, if you don't already have it. Unmount and disconnect the external. A -36 error could also be just a poorly connected cable, or a bad cable or port. Remove all cables and reconnect making sure the connections are tight.
    -mj

  • How to use an external hard drive and copy files to the disk for mac and windows??

    please tell me how to copy files to external hard disk and use it for both mac and windows. there is the fat32 formatting bt i dont wanna use formatting because i already have a lot of content on the exteral hard disk. thank you.

    It is simplest to have the HDD formatted to noe common to both Mac an PC.  ExFAT is one.  But to do that will erase all data on the HDD.
    If the HDD id formatted NTFS, Mac can read but not write to it.  The solution then is to use a third party application such as Paragon or Tuxera which will overcome that obstacle.  These applications do have mixed reviews.
    Ciao.

  • Find and copy files by file name

    Hey Gang,
    I sure hope you guys can help me out. I'm looking for a piece of software that can read a txt file or spreadsheet to find specific files and copy them from one place to another.
    In other words, I have a folder with 1000 files in numerical order from 1 to 1000. I need software that can copy only selected images (ie 4, 53, 244, 456, 999, etc...) to a separate folder.
    Any Ideas?
    -Chris

    This is very simple to do with a script.
    Let's assume that the files are in /Users/cnhoward/source and you want to move particular files to /Users/cnhoward/dest. Let's say you have a text file, numbers.txt, with one number on each line, and the files are named like 'file_X.txt' where 'X' is the number. Then you could do this in terminal:
    for n in `cat numbers.txt`
    do
    cp /Users/cnhoward/source/file_${n}.txt /Users/cnhoward/dest
    done
    You don't give much in the way of details, but that should give you an idea to start from.

  • CF9 CPU at 100%. Moved to new CF11 server and copied files over and it's still at 100% CPU almost immediately on new server

    Our web server is stuck at 100% CPU.  Three days ago we were on CF9 and started running into this problem until the server crashed and wasn't salvageable.  Luckily we had a fresh Windows 2008 Server R2 ready to go with a fresh copy of CF11 on it.  I copied all the website files over and we were back up and running.  A day later the CPU is back to 100% on the new CF11 Windows 2008R2 server.  I also updated CF11 to the latest update 3 that was just released.
    If I turn off the CF service the CPU usage goes back to normal.  If I turn CF back on, the CPU goes back to 100% within like 5 seconds.  So it doesn't seem like some slow running page or anything that eventually eats up all the memory or whatever.  I'm not an expert at looking at the logs, but I don't see anything too out of the ordinary.  The one thing that looks strange to me is I see this line over and over.
    Dec 12, 2014 11:28:41 AM Information [ajp-bio-8014-exec-59] - Starting HTTP request {URL='http://zzen1wbudopwg.nchyt.com/encfm/en0024-ssj5iway6wvg/cbeim94a1s2kebu.php?do=194', method='get'}
    That line makes me think we got hacked somehow, but it's hard to know.
    I did up my JVM heap size and max size to 1024MB.  We have 4GB of memory.  And i changed teh JVM arguments to what's below based on a forum post.  Nothing seems to help.
    -server -XX:PermSize=192m -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.home={application.home} -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog -Duser.language=en -Dcoldfusion.rootDir={application.home} -Dcoldfusion.libPath={application.home}/lib -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true -Dcoldfusion.jsafe.defaultalgo=FIPS186Random
    Any additional ideas on how to debug this or what to look at?  Thanks!

    Thanks Charlie for your insight.  I searched everywhere to find a cfhttp request that was causing the issue, but couldn't find it.  I did find some unusual files that were loaded though that I know we didn't put there.  I did a search and found this link that shows the code.  Coldfusion CFIDE bitcoin mining exploit – PHP involved… | code-complete.com and that you mention in your article too.  I don't see any of the executables running or files that were mentioned though.  I found that code in 8 different spots though and removed them.  Maybe our old server had the executables and hacked files on them.  Hard to know as it won't boot up anymore!
    I think I did possibly isolate the HTTP request {URL='http://zzen1wbudopwg.nchyt.com/encfm/en0024-ssj5iway6wvg/cbeim94a1s2kebu.php?do=218', method='get'} in the http.log file to a certain site in IIS though.  And it wasn't our main site.  I turn off this website in IIS and it appears the weird request goes away.  I turn the site back on and it starts to re-appear.  It doesn't always load constantly so it's a little hard to tell.  This site is pretty small.  I went through each file on the site and did find one file that did appear to be hacked.  It wasn't coldfusion code though.  Just some html links.  I removed it.  That's all I could find.  No cfhttp calls or anything else.
    We re-installed Coldfusion 11 on Friday as well and upgraded to Update 3.  It doesn't stay locked at 100% as much right now, but it being over the weekend we don't get much traffic.  Monday will be the real test.  I think I will leave that smaller site turned off for now and see how things perform.  I'm doing a full virus scan for the heck of it overnight too.  Don't really expect it to find anything though. I also turned on advanced logging in IIS 7.5 and don't see anything out of the ordinary.  I made sure client variables weren't in the registry either.
    Here's a part of the http.log file when I turn the IIS site on.  I turn the site off and it stops popping up in the logs.
    "Information","ajp-bio-8014-exec-57","12/13/14","22:33:14",,"Starting HTTP request {URL='http://zzen1wbudopwg.nchyt.com/encfm/en0024-ssj5iway6wvg/cbeim94a1s2kebu.php?do=233', method='get'}"
    "Information","ajp-bio-8014-exec-57","12/13/14","22:36:17",,"Starting HTTP request {URL='http://zzen1wbudopwg.nchyt.com/encfm/en0024-ssj5iway6wvg/cbeim94a1s2kebu.php?do=601', method='get'}"
    "Information","ajp-bio-8014-exec-57","12/13/14","22:38:31",,"Starting HTTP request {URL='http://zzen1wbudopwg.nchyt.com/encfm/en0024-ssj5iway6wvg/cbeim94a1s2kebu.php?do=459', method='get'}"
    "Information","ajp-bio-8014-exec-57","12/13/14","22:38:54",,"Starting HTTP request {URL='http://zzen1wbudopwg.nchyt.com/encfm/en0024-ssj5iway6wvg/cbeim94a1s2kebu.php?do=108', method='get'}"
    "Information","ajp-bio-8014-exec-57","12/13/14","22:39:55",,"Starting HTTP request {URL='http://zzen1wbudopwg.nchyt.com/encfm/en0024-ssj5iway6wvg/cbeim94a1s2kebu.php?do=218', method='get'}"
    "Information","ajp-bio-8014-exec-63","12/13/14","22:52:03",,"Starting HTTP request {URL='http://zzen1wbudopwg.nchyt.com/encfm/en0024-ssj5iway6wvg/cbeim94a1s2kebu.php?do=54', method='get'}"
    "Information","ajp-bio-8014-exec-64","12/13/14","22:57:32",,"Starting HTTP request {URL='http://zzen1wbudopwg.nchyt.com/encfm/en0024-ssj5iway6wvg/cbeim94a1s2kebu.php?do=40', method='get'}"
    "Information","ajp-bio-8014-exec-64","12/13/14","22:58:37",,"Starting HTTP request {URL='http://zzen1wbudopwg.nchyt.com/encfm/en0024-ssj5iway6wvg/cbeim94a1s2kebu.php?do=702', method='get'}"

Maybe you are looking for

  • Shoppinf cart creation to creation of backeend PO

    Hi all, this is sankar. I am new to SRM-EBP. I want to know some technical details about how the process goes starting from the SC creation to the backend PO creation. ( i mean what are all the programs that work in between) 1) first of all i want to

  • 1140 AP Other Network

    I'm configuring an 1140 and trying to make it invisable to any user that doesnt know the SSID. The SSID is not broadcast, however my clients see "Other Network" in their list of available networks. Short of turning off the AP is there any way through

  • Upload image from Mobile device using SAP ui5 controls

    Hello Team , Can we use SAP UI5 controls to upload image from photo gallery of the mobile device, the idea is to use simple sap UI5 codding and not SMP. please do let me know if you guys have idea on same. Armaan 

  • How can i make something look like it was embossed in PS?

    I have a simple shape...a rectangle filled with a solid color. It is a separator bar on a poster. I want the top of the bar to have highlight and the bottom of the bar to be darkened. (As if I brought it into PS and applied an emboss filter) I tried

  • Incompatibility with Photoshop CS2 ??

    I was running Photoshop CS2 two weeks ago, then last week it would crash every time. Has something in the OS  changed that would cause this?  I have repaired disk permissions and trashed the Prefs file.  Is there anything else I can do to prevent the