Copy foldername and specific indd files.

Hello guys
I need a function,
there is first a dialog-window that appears, from the dialog-window I select some indd files and pressed ok.(that have not to be all indd files from the folder)
then appears a new dialog window so I can select a target to copy the selected files into also, copy the foldername from the selected indd files location and create that folder and put the files when I have selected a target.
finally  create a textfile to save all indd filenames in / or if its possible to tag them in another way so I got them in.
I know in mac finder you can put a color on files.
Could someone help me out?
Thank you in advance
All Adobe Members
Cheers!

Works like a charm,
How do I set a default path for the FileDialog?
here is a old code I used to do that with,
function CopyStep1()
var myPath = (File($.fileName).parent.parent.parent.fullName).split("/Kommuni/LaRe/LareAUTO/");
var jobName=(myPath[1]); // filtrera bort jobbnummret för att kunna plocka parrent from aktiv path.
var myJobnr= (File($.fileName).parent.parent.parent.fullName);
mFolder = Folder(myJobnr);
mFolder = mFolder.selectDlg();
  if(mFolder != null)
  var myFiles = mFolder.getFiles('*.indd'); 
  for (i = 0; i < myFiles.length; i++) 
  var myFile = myFiles[i]; 
  destFile1= new File(MYmyFile.name);// to create an object 
  myFiles[i].copy (destFile1);  
Thank you so much in advance sir

Similar Messages

  • Copying folders and Subfolders with files using Promises WinJS

    Hi,
    I have app written in WinJS.
    I want to copy a particular folder along with its subfolders and their files. I am so far successful with copying folders. Below is the code for the same.
    app.CopyFolder = function (folder, destFolder) {
    var replace = Windows.Storage.CreationCollisionOption.replaceExisting;
    //console.log("create folder: " + folder.name);
    return destFolder.createFolderAsync(folder.name, replace).then(function (newdest) {
    return app.CopySubFolders(folder, newdest);
    app.CopySubFolders=function(folder, destFolder) {
    return folder.getFoldersAsync().then(function (folderlist) {
    return WinJS.Promise.join(folderlist.map(function (folder) {
    return app.CopyFolder(folder, destFolder);
    Now after I have copied all the folders I need to copy their respective files. The problem is I am stuck,I get the files copied but I want to proceed ahead after all the files are written to their respective folders. Below is the code for the same.
    app.copyAllFiles = function (fileList, destStorFolder) {
    console.log('copyFiles Start...');
    var promises = [];
    var fileCopied = 0;
    var collideOpt = Windows.Storage.CreationCollisionOption.replaceExisting;
    return WinJS.Promise.join(fileList.map(function (file) {
    return app.copySingleFile(file, destStorFolder);
    app.copySingleFile = function (fileObject, destFolder) {
    var promises = [];
    var fileCopied = 0;
    var path = destFolder.path + "\\" + fileObject.folderName;
    var collideOpt = Windows.Storage.CreationCollisionOption.replaceExisting;
    return Windows.Storage.StorageFolder.getFolderFromPathAsync(path).done(function (folderObjectOfLocalFolder) {
    return fileObject.fileObject.copyAsync(folderObjectOfLocalFolder, fileObject.fileName, collideOpt).then(function (fileObject) {
    console.log("copied single file:" + fileObject.name);
    The problem is when i run the folder copy code and apply breakpoint for the success call back of 
    CopySubFolders(source,destination).done(/*my breakpoint*/)
    The folders are created.
    But when I try to breakpoint for my copyAllFiles,the files are created only when i pass the success call back.
    Can anyone tell me what am i doing wrong? How can I proceed ahead only when all the files are written successfully.
    Regards,
    Ninad 

    Hi,
    I tried the above solution but what i want is that the action of copying folders and subfolders along with the files should be done with promises and that promise should return only when all folders,sunfolders and their files have been copied. I want to
    do it in this way because I want to perform certain second action only when all things are copied.
    If I do it the as per the link the function runs in the background and my second action proceed aheads and may cause error if it finds some folder or file missing.
    So I came up with following above code,first copy folders then copy. The copy folder works as expected but the files are getting copied only when the file copying code enters the success call back.
    Can you please shed light on my code where I am going wrong.
    Or is it ok to proceed ahead with the solution you mentioned at the link cause I dont want any runtime crashes.
    Regards,
    Ninad

  • Can't open .indd file suddenly!

    I have a large file that has been opening just fine for weeks. It's 300 pages and an .indd file. I have tried to open back-ups of this file and none with the same file name will open. I tried opening the file on another computer and it still would not open. 
    I have opened other earlier versions of the file (different file  name) and other unrelated files with no problem. I opened larger files with no problem. I'm  thinking some how this file is corrupted.  i get a message when i try to open it that says: indesign can't open ***.indd." I just did some revisions that will take a huge amount of time to redo so I'd like to get this file opened somehow. I have a recent .pdf, possibly I could import that?  If not is there anyway to at least print a copy without actually opening it.
    This all happened when i decided to create a Book file into which I would bring this file and then add a TOC, other front pages Glossary and index. I've been avoiding this step but thought it would facilitate bringing in everything together without creating one huge file.
    Before taking the following step I  saved a copy of the original file on another hard drive.  Then I set up the Book and when I tried to bring my original file into the book it failed. After that I could not open any of my saved recent back-ups with the same name on other hard drives. I have three.
    What if I try changing the name of the file before opening it, because I'm thinking it all has something to do with trying to bring it into the book file? Possibly try changing the file designation to .indd to .indb?
    One odd thing, When I look at the file that won't open on the hard drive, it seems to have recorded the last time i tried to open the file as if I had actually opened it even though indesign gave me the "can't open" message.
    Any  suggestions would be greatly appreciated.
    Jim

    This is a follow-up.  My question has been answered in that  did get to open the file as follows:
    By trial and error (based on responses)  basically I was able to open the file as a copy from inside InDesign. There are three options in the lower left had corner of the window, I picked copy after trying the other two. Up until this time I could not find any idlk file.
    Once I opened the file I backed it up and made another copy that I opened.  I went back to the original file and tried to open it from finder. It would not open. Still no sign of the idlk file.  But when I went back to open the work copy it opened but now the idlk file popped up in the finder  and it continues to do so every time I open any file associated.    This idlk file comes up with an icon that says "Locked"
    My only question now: Is there a way to unlock this file from whatever it is linking to? Does it make any difference at this point?
    I have learned this is a temp file of sorts that prevents changes to the original file. I would like to unlock the file so that it not connected to anything.
    I have moved or deleted all files that it might be linking to.  I have shut down other computers and hard drives using the same network. The idlk file come up every time. It goes away when I close the file.  I have also deleted it while the file is open. I deleted all attempts at creating Book files. I'v been through preferences and checked Assignments. It seems like once you make a copy of a file, the original is always looking for the copy? Or the copy for the original?
    So I'm working and making separate files for each chapter so that I can set up a book and have back-up and maybe create a whole new Book file that isn't linked to anything else but maybe that's not necessary.
    I've been working with InDesign for a long time and never encountered this phenomenon before.
    Thanks again for your responses.
    Jim

  • I need code for copy ,cut and paste

    please help me to find acode for copy,cut and paste .
    from file to another.

    Try playing with this;-
    java.awt.Toolkit.getDefaultToolkit().getSystemClipboard()

  • .INDD files not showing cs4 icon

    ...after an hour on the phone with tech support..I'm turning to the masses.
    I've right clicked the file/prop/to change the program to open the file type with.
    Indesign CS4 is not on my program list.  When I select browse/program/adobe/indesign cs4 and selet the .exe file and hit open..
    the window disappears and indesign is NOT added to the list or available to select.
    I also have tried control panel/folder options/file types and have tried to manually force it to use CS4 to open INDD files...  however, indesign CS4 is not on this program list either..
    I CAN however open and use indesign 4 and open indd files in the program.. however ctrl/s opens the save as dialogue box instead of just saving it...
    all indd files have a 'windows-esqe' icon.
    HELP
    thanks
    Dsgngirl

    Did you by chance delete an earlier version after installing CS4? This has been know to cause this sort of behavior.
    I think the best advice is to reinistall the program, which should repair the .dll file that handles the icons for the various versions.

  • Copying large amount of small files across network: Files are missing

    On my iMac, i have a directory with 1440 small files (about 100k each). I select all of them, and drag them to a folder on my Mac Mini. The copy finishes quickly, but there are always a few files missing, somtimes 5, sometimes 15, or anything between.
    When selecting half of the files, the same problem occurs. Even when I narrow the selection to 100 files, it occured once that only 99 of them were copied.
    Both Macs run 10.5.2 and are connected through a Cisco gigabit switch.
    I solved by zipping the files in 1 archive and transferring that, but of course that is hardly a worthy workaround. One of the most basic file operations, copying across a network, should work flawless in my opinion.
    Do any of you have similar problems? Or perhaps a solution? This, together with the wireless and standby-problems on two MacBooks here, make me consider downgrading to Tiger for the time being.

    Scott Oliphant wrote:
    iomega, lacie, 500GB, 1TB, etc, seems to be drive independent. I've formatted and started over with several of the drives and same thing. If I copy the files over in smaller chunks (say, 70GB) as opposed to 600GB, the problem does not happen. It's like finder is holding on to some of the info when it puts it's "ghost" on the destination drive before it's copied over and keeping the file locked when it tries to write over it.
    This may be a stretch since I have no experience with iomega and no recent experience with LaCie drives, but the different results if transfers are large or small may be a tip-off.
    I ran into something similar with Seagate GoFlex drives and the problem was heat. Virtually none of these drives are ventilated properly (i.e, no fans and not much, if any, air flow) and with extended use, they get really hot and start to generate errors. Seagate's solution is to shut the drive down when not actually in use, which doesn't always play nice with Macs. Your drives may use a different technique for temperature control, or maybe none at all. Relatively small data transfers will allow the drives to recover; very large transfers won't, and to make things worse, as the drive heats up, the transfer rate will often slow down because of the errors. That can be seen if you leave Activity Monitor open and watch the transfer rate over time (a method which Seagate tech support said was worthless because Activity Monitor was unreliable and GoFlex drives had no heat problem).
    If that's what's wrong, there really isn't any solution except using the smaller chunks of data which you've found works.

  • Script to open INDD files, run script, and close

    Hello, I'm looking for a script that will open a folder of Indesign files, open each one, run a selected script, then close each file.
    RIght now I'm using the Batch convert script, to convert INDD to INDD and run the script in between (then I delete the extra INDD file). But I'm trying to eliminate the conversion element, just need the script part of it.
    Anyone have any help? Thanks.

    Here's my whole code if it helps. I'm wondering if the script is moving too fast. I think that the first files are still PDFing while the others are opening and closing. Could that be it? I'm not sure why else the for loop for the PDFing is only working on the first file.
    var myFolder = Folder.selectDialog("Select Input Folder");
    var myIndsnFiles = myFolder.getFiles("*.indd");
    var exportPath=Folder("/").selectDlg("Select PDF output folder:");
    var pdfPreset = "Press Quality";
    for(k=0; k<myIndsnFiles.length; k++)
        app.open(myIndsnFiles[k]);
        var jobNumber = "12345";
            for (aPage=0; aPage < app.activeDocument.pages.length; aPage++)
                app.pdfExportPreferences.pageRange = app.activeDocument.pages[aPage].name;
                app.activeDocument.exportFile (ExportFormat.PDF_TYPE, File(exportPath+"/"+jobNumber+"_"+pad(app.activeDocument.pages[aPage].name)+".pdf"), false, pdfPreset);
                function pad (n) {
                return ("00000"+n).slice(-3);
    app.activeDocument.close();

  • I converted aif files to mp3 files in I tunes so I could put them on a flash drive.  Now when I transfer an album to the flash drive I get both the aif files and the mp3 files in the flash drive.  How do I get the iTunes to only copy the smaller file?

    I converted aif files to mp3 files in iTunes so I could put them on a flash drive.  Now when I transfer an album to the flash drive I get both the aif files and the mp3 files on the flash drive.  How do I get the iTunes to only copy the smaller file?

    My suggestion to use the smart playlist was more along the lines of making one list with rules to show everything in your library as long as it was kind "mpeg" (= mp3).
    Smart playlists cannot be edited manually, only by changing the rules.  You can use them as the basis for another smart playlist though.
    There is added overhead to using smart playlists, so don't go overboard.

  • Does anyone know how I can copy photo and video files from the Photo's app on my Macbook, to a USB stick or other external back-up?

    I've updated the software on my Macbook to the most recent version; regretting it now; and iPhoto has now become the Photo's app.
    The problem is I can no longer back up my photo and video files taken on my phone, saved to my mac, by copying them and saving them on a USB stick or other external hard drive.
    I could easily do this with iPhoto, but now Photos app does not let me copy the files when I select them.
    Does anyone know if there's a way to save, copy or back-up my photo's and video files: prefreably one that doesn't involve iCloud, as I don't feel like paying for more storage; there must be some way to access those photos/videos from my iPhone to save on another source?

    The problem is I can no longer back up my photo and video files taken on my phone, saved to my mac, by copying them and saving them on a USB stick or other external hard drive.
    Select the photos and videos in Photos and use the command "File > Export"  and select a folder on your USB stick to save the photos to.

  • Can you copy/paste files from the Finder to Mail in Lion, or drag them onto the Mail icon in the Dock to create a new message and attach the files to it?

    Message title says it: Can you copy/paste files from the Finder to Mail in Lion, or drag them onto the Mail icon in the Dock to create a new message and attach the files to it?
    I can't find anything in the Knowledge Base that says these two options no longer work or still do.
    I do not have a system capable of running Lion, but I need to know the answer nonetheless.

    Gee, I don't know: "paste attachments mail Lion"? ;-)
    One further question, if I may: in Panther (which is where I've aggregated nearly 7 years of mail), if you copy more than one file in the Finder, switch to Mail, and paste the files into a new message, only the file names paste in. If you copy one file and paste it into a Mail message, you get the file, not just the name. Is that still true, or has that (IMHO) bug been fixed since 10.3.9?

  • CTrying to figure out why I can't load or copy any photo or video files from my laptop to my IPhone. I have a 3gs and am using the latest verson

    My laptop uses Windows 7 and, on several occasions, I've tried to copy photos and videos to my IPhone so I can take them with me but nothing seems to work. I always get a message saying that the devise is no longer connected or failed to work. This applies to all functions of copy/paste or drag and drop. I was told that it had something to do with the way I was set up with regard to syncing but I'm not able to find anything that changes it. I can copy files to my Cloud Drive on the computer but nothing ever transfers in from my phone either. What's up?

    What is selected under the Photos tab for your iPhone sync preferences with iTunes?
    If the videos are in an iPhone compatible format and are in a folder of photos selected to be transferred to your iPhone under the Photos tab for your iPhone sync preferences with iTunes, do you also have Include Videos selected under the Photos tab?
    Or if the videos are in an iPhone compatible format, they need to be in your iTunes library and can be selected under the Movies tab for your iPhone sync preferences with iTunes to be transferred to your iPhone.

  • I'm not able to copy and paste files from my mac to hard disk and usb. I have tried dragging the items to those devices but it won't work. I also have tried copying and pasting those files onto those devices but that doesn't work too. Can any one help?

    I'm not able to copy and paste files from my mac to hard disk and usb. I have tried dragging the items I want to copy to those devices but it won't work. I also have tried copying and pasting those files onto those devices too but that doesn't work too. Can any one help?

    Hi BobRz
    Thanks for you suggestion but it didn't work - are there other ways for solving this problem? Or is it because my files that I want to copy and paste onto my hard disk etc are too big? (However there is space on my hard disk and it works on a PC)

  • Error 36 and External Drive File Copy Problem & USB Connections

    In attempting to copy a folder with some 200G+ of files from my iMAC, with OSX 10.6.7, to an external portable WD 1Tb HD, newly formatted to HFS+ (journaled), and connected to the iMAC via a USB cable to the USB port on the iMAC keyboard, I kept getting an error message that Finder could not complete the operation as some data couild not be read or written and transfered, and gave the "Error Code -36". After some searching ont he internet for this error code I came across a host forums discussiong the error code BUT all referred to it being the result of MAC OS hidden "dot-underscore" companioned files being created when the MAC OS X file system copies or moves files to a FAT16 or FAT32 volume. This was not the situaion in my case a both drives were OS X formatted HFS+. Eventually I came across a very vague reference to the error also occuring when the cable connection with the external HD was not solid. I reconnected my external HD and attempted the file transfer again - with the same result. Eventually I decided to plug the external HD into a USB pot on the back of the iMA itself, rather than the keyboard set. Sure enough the error issue disappeared - the transfer successfully completed.
    So my question relates to the "usb connection" challenge with iMAC. the iMAC has only 4 USB ports on the back directly. I did have two desktop external HDs plugged into 2 of these USB ports at the back of the iMAC, as well as a WACOM pad device into the 3rd, and an EPSON 3880 printer into the 4th, and so was forced to employ the ports ont he keyboard for portable HD. So - what's the answer in a situation where the 4 are insufficient and it would appear that the keyboard ports seemed to be unpowered?? Any suggestions?

    It's actually a Time Machine backup drive which is formatted in Mac OS Extended (Journaled). I wish I'd copied the exact error message.
    I believe it was something to the effect of "Error 36: The file could not be copied because some of the date could be be read/written" or something along those lines. Next time it comes up I'll copy it. I have Drive Genius running with DrivePulse, but it doesn't ever seem to start.
    My biggest concern is that this is a sign that the drive is failing. When backing up, it also slows, or stops midway through and just hangs there. Though I haven't done a lot of extensive testing on that because if the drive is failing, I don't want to speed that process up any more.
    To add to the complication, there is a second external drive which Time Machine is also backing up for me. There is one particular file, the Virtual Machine file, I was trying to get off the other external drive and it produced the same problem. That's when I went into Time Machine to try and retrieve the file that way and it did the same thing. The other external drive is making some sounds, but it doesn't sound like a distinct clicking, more like a more pronounced version of the normal constipated hard-drive sound. The Time Machine drive, isn't making any obviously strange sounds at all.
    So, I can't tell whether the drives are failing or if it could actually be that particular file itself causing some strange problems.

  • I had made a copy of the main revel file on my mac, and then i put it in my google drive folder for safety. I accidentally deleted one of the two libraries form my iPhone. I opened it up and panicked and thankfully I guess I had a backup of the other libr

    I had made a copy of the main revel file on my mac, and then i put it in my google drive folder for safety. I accidentally deleted one of the two libraries form my iPhone. I opened it up and panicked and thankfully I guess I had a backup of the other library in my spouses phone... but mine is still gone. I don't have them saved to my computer... the pictures are important and I really really need them back.  Is there a way for me to get the pictures back from what I believed at the time was a smart way to backup when i made a duplicate of that main mac file to my google drive? The best way to let me know is my email... [email protected]  I am really relying on you guys if there is a way?

    Hi meghage,
    From your code, it is a WebForm project.
    This forum is to discuss problems of Windows Forms. Your question is not related to the topic of this forum.
    You can consider posting it in asp.net forum for supports . Thanks.
    ASP.NET: http://forums.asp.net
    Regards,
    Youjun Tang
    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.

  • I have files in my iTunes media folder that somehow are not in my library. How do I get iTunes to scan my media folder and add missing files to my library without making a copy of each file in the same location?

    I have files in my iTunes media folder that somehow are not in my library. How do I get iTunes to scan my media folder and add missing files to my library without making a copy of each file in the same location? If I use add file / folder to library, it scans the folder and then makes a copy of any file that is not in my library in the exact same location; I recal in older versions of iTunes being able to just drag my media folder into my library and it would update missing links.

    Only the songs that are connected to iTunes will be copied when you consolidate to a new folder.
    Splitting the media folder away from the usual location makes it harder to move iTunes in the future.
    Are you go move everything back once you've tidied up or are you going to leave it that way? Either way I'd recommend you create an iTunes folder at the new location, an iTunes Media folder inside that, and consolidate to this new iTunes Media folder. You should also use the option File > LIbrary > Organize Library > Rearrange files in the folder "<Media Folder"> if you have not already done so.
    tt2

Maybe you are looking for