[ID3 JS] Problem relinking files

Hi folks, I need to copy specific filetypes from a document to my disk. I've wrote the script below to help me automate this task. When I use the copyLink method InDesign updates the document to use new link location. To fix this I relinks all affected links back to the original filepath. However when relinking InDesign won't copy all my links. If I disable the relinking all files gets copied. My relinking function is obviously not well designed. I was hoping one of you could give me a hint or two?
var myDocument = app.documents[0];
var files = myDocument.links;
var myStr = prompt ("Substring");
if (myStr != null) {   var myFolder = Folder.selectDialog ("To where");   }
if (myFolder != null)
      for (var i = 0; i < files.length; i++) {
         copyFiles(files[i], myFolder+"/"+myStr, true);
function copyFiles(myLink, linkTo, doRelink) {
   var myOldFilePath = myLink.filePath;
   var myFolder = new Folder (linkTo);
   var myFile = new File(myFolder+"/"+myLink.name);
   if (!myFolder.exist) {
      myFolder.create();
   if (!myFile.exists) {
      myLink.copyLink(myFile);
      myFile.close();
      if (doRelink) {
         relinkTo(myLink,myOldFilePath);
function relinkTo(myLink, linkTo) {
      var myFile = new File (linkTo);
      myLink.relink (myFile);
      myLink.update();
Regards, Rasmus

Rasmus,
Ignore my previous post. Here is my way to do this:
var myDoc = app.activeDocument;
var myLinks = myDoc.links
var myStr = prompt ("Substring", '');
if (myStr != null) {
     var myFolder = Folder.selectDialog ("To where");
     var mySubFolder = new Folder (myFolder.fsName + "/" + myStr);
     if (!mySubFolder.exists) mySubFolder.create();
if (myFolder != null) {
     for (i = 0; i < myLinks.length; i++) {
          var myLink = myLinks[i];
          var myFile = new File(myLink.filePath);
          var myNewFile = new File(mySubFolder + "/" + myLink.name);
          myFile.copy(myNewFile);
Kasyan

Similar Messages

  • Problem  relinking files

    When I relink an events file, fcp x gets "not responding" and I heve to "force quit". I`ve done this several times before, without problems. Thanks for yours suggestions

    Sometimes it takes a while for Final Cut and usually comes out of not responding state. If you have already waited maybe the file you are trying to import is corrupt? try making a new event and importing the files just to make sure.

  • Missing ID3 Tags on Song Files

    I have a obscure problem with iTunes that has me very frustrated. I selected my entire music library, then right click -> get info -> check boxes for artist, genre, album, etc and then hit okay. I thought this would look for missing tag information in songs and fill in the blanks, but instead it erased the tag information for all the songs in my library.
    Luckily, my hard drive was spared. When I open up the C: drive and look at my music folder, nothing has changed. All of the mp3 files are still tagged with the correct information. The only problem is that when I try to access songs from iTunes they appear to have no such tag information.
    I have tried fixing this by deleting everything from iTunes and then adding it all back, but this didn't help. Reinstalling iTunes and a full Windows system restore didn't help either.
    The result of this is that I'm afraid to sync my iPod with my computer until this is all resolved. Any insight into the problem would be greatly appreciated. Thanks.

    Ooops. You just created a lot of work by erasing the tag info.
    I think there are some scripts out there that can fill in ID3 tags based on file names.
    This page is from an apple discussions regular poster:
    http://samsoft.org.uk/iTunes/scripts.asp
    You could try the "TagFromFilename" script.
    For future, itunes does not have the ability to update tag info like Windows Media Player does. I suppose you could see what WMP will do, before trying that script.
    Since I haven't used either one to do this, I can't say how well either works.

  • Final Cut Pro X Error in relink file

    Final Cut Pro X. I have a problem: I can not relink the original files of a project that I've moved on an external hard drive. After finishing the work, I run a copy of the project following the procedures of Final Cut Pro X, but now that I reserve that project at the time to reconnect the file, it gives me this error "Incompatible file. The original file and new files have different audio source and channel counts. Relinked files must have the same media type and similar audio channels as the original files, and must be long enough to cover all the clips That reference the files ". The other times I had done this, it made me work quietly. Is the first time that happens to me. What has happened? How can I fix the problem?
    My version of Final Cut Pro X is 10.1.3, and my operating system is OS X Maveriks 10.9.5.
    Help me, thank you.

    Wow, that was quick. Which drive do I rename? The external or the one with Mac OS installed?

  • Relink files to pluraleyes xml file

    Hi, I'm a videography student working in a team, and we are having some problems with filesharing. We have done a bunch of multi-camera shooting, and synched most of the clips in FCPX with multicam. For some reason the multicam clip for one interview didn't work, though (This is one long audio file, with multiple video files from two different cameras), so my partner synched it in pluraleyes and sent me the xml file. When I imported the xml file I got a string of error messages saying that "the item could not be read." Looking at the file paths in the error messages I saw that they were for my partner's hard drive, so I figured I just needed to relink the original video/audio files, which are all on my hard drive and already imported to FCPX. However, when I click on the clip or the event and go to file-->relink files, the "locate" button is grayed out. I'm totally confused and don't know what went wrong. Any ideas?

    Hi, thank you so much for responding! I realized you're right, of course I can't relink the multicam itself, but I don't see how to relink them with the angle editor. It doesn't show clips in red--the angles are simply black, empty. I'm actually not sure how to see the individual clips at all in the angle editor, because each angle contains multiple clips in sequence. (Because the cameras would only record 20 minutes at a time, and this was a long interview.)

  • Relinking files in many subfolders

    Does anyone know how to relink files that are in multiple folders at once?
    My scenario.
    I was linked to a hard drive that died. But like a good girl I have backed up my indesign files, images and graphics. My problem is that they are in multiple folders with multiple subfolders. So all links come up missing and when I relink I only get the additional 2-3 images that are in that folder. I have 600+ images to relink. Is there anyway for indesign to relink to a parent folder and ask it to relink to all the subfolders included? I can't rename the server to my hard drive name to fool it either.
    Thanks for any help on this.

    If the folder structure is identical, but the volume name is different, they yes, you can do it. Re-link just one file, and note its name. Now export to .idml (or .inx if using CS3 or lower). Open that file in a text editor and find the links by searching for the name of both the file you fixed and any other file, Note the difference in the paths and use Search and Replace in your text editor. Save, then open that file back into InDesign.
    Here I have opened an .inx file in TextEdit and highlighted the path and filename of one of the links.

  • Problem using File sharing  in a small office network

    I have a problem using File sharing on an Imac and Macbook Pro.
    My office has a small network running Windows Small office file server 2003. I have one Windows 2000 PC connected to it and 3 Macs, an 2.4 gHz Intel iMac running Leopard 10.5.6 , a MBP running the same and a Mac Mini running 10.5.
    From the Finder Shared window of the Mac Mini, I can see all the computers on the network. It also used to be the case for the iMac, but the MBP could never see the Windows PC’s, not the server or the Win2000. This wasn’t a big problem as I was communicating between the Macs and using the shared printer on the iMac.
    On Monday Jan 19 the iMac was suddenly unavailable to the other 2 Macs. It was working normally on the Friday. The iMac can access the Mac Mini and copy files to it. The Mac Mini can see the iMac but cannot access it. Even trying to connect as, ends in a failed connection. I have tried rebooting, turning File sharing off and then on again to no avail.
    The iMac now also cannot see the Windows PC’s which it previously could.
    To get files from the MBP for printing, I now copy it to the Mac Mini and acces the folder from the iMac, a very tedious procedure. I don’t know why this happened and am scared that the Mac Mini is going to do the same thing.
    All three computers are also running VMware 2.0 with Windows XP pro, and from VMware the server is visible on all the computers.
    Any help will be much appreciated, I live in a small town in South Africa and the local computer suppliers have no knowledge of the Macs.
    I think that the problem with the iMac may have started after a software upgrade to 10.5.6 but I am not entirely sure.
    Thank you
    ajdk

    Well, you're current method sounds pretty good. But if you want to user a file server, hey go ahead.
    What you want to do when you centralize project files is to keep track of which one is the newest and becareful not to overwrite files with the same name. So you either have to set up individual spaces on the server (separate AFP/FTP folders maybe), or you'll need to run a file checkout service.
    The individual space is cheaper, but it's not much of a difference from backing up to the network drive. Since you have Gigabit connections, you might even opt to save ALL the user files on the server instead of just the project files.
    If you want to run a file checkout service, there's two approaches. You can run a service that can host any kind of file, or you can run a version control system for each kind of application (Photoshop, Word, etc.). Please notice, that as you read further and further along, the methods become more and more expensive and complicated. Once you get to this point, it will be necessary to purchase or build software in addition to the Mac OS X Server package.

  • Problems with File Transfers Over Firewire 800

    Problems with File Transfers Over Firewire 800.
    Over the past month, I have had problems when transfering files from my harddrive, over Firewire 800 to a portable drive. I usually transfer very large files (20gb or more) to the portable drives for moving files around. When I drag a file over to copy onto a drive, the transfer starts normally. If I drag more files to copy over, the computer screen goes darker and a large icon comes up that looks like a power button icon. It tells me to restart, so I have to do a hard shut down on my G5. Weird. I also get the dark screen of death sometimes when I am transfering those large files and open another application to do some work while it's copying. It's killing me. I am having to sit here and wait for the transfer to finish before I can do anything.
    Any thoughts...
    Dual 2.7 GHz PowerPC G5
    Mac OSX 10.4.3
    Dual 2.7 GHz PowerPC G5   Mac OS X (10.4.3)  

    Have you run the Apple Hardware Test? Sounds like it could be a RAM problem.

  • Error while opening pdf in reader in windows 8:Can't open this file. There's a problem with file format

    I have a problem with a pdf file which does not open with reader in windows 8 but it opens properly with adobe pdf reader. All other pdf can be opened in reader.But when i open a pdf(see this link for pdf for which i got error http://incometaxsoft.com/temp/Form.pdf)
    it gives error as "Can't open this file. There's a problem with file format".
    The same file opens properly in adobe pdf reader.You can check the pdf file which i have mentioned in the link above.But the reader which comes with windows 8 can open some other pdf in the same PC.What may be the error causing this??

    This has turned out to be an enormous issue for me as I sell PDF files as ebooks. I have done a fair amount of investigating this for my system.
    My files have to be compatible not just across readers but across operating systems.
    To date, I have over 200 PDFs that have functioned flawlessly across Mac, PC (Windows 7 and below), Android, iPhone/iPad, Linux.
    I personally test my PDFs using a variety of readers and PDF editors including
    PDF XChange (my favorite)
    Foxit (runner up for me and I recommend for most people)
    Adobe (the bloated monster)
    Nitro 9 (great for moving graphical elements around)
    ABBYY
    And the Nuance PDF Create toolsets
    Those are off the top of my head. There are a bunch on Android that I test with too.
    I am running the Windows 10 Pro Tech Preview and I have this same problem so I know it isn't fixed yet in any kind of pre-release way (-sigh-)
    Here is what I've learned for my situation
    The PDFs I created using NUANCE'S PDF CREATE PROFESSIONAL VERSION 8
    all fail using the built-in Windows 8/10 PDF reader.
    When I look at the PDF properties for these Nuance created files, the underlying engine used to write them is called "ImageToPDF". Using ABBYY it indicates their own engine as does everyone else that I've tried. It is easy for you to check to see
    what created your PDF by doing a "Control D" (look at the document properties). Perhaps there's a common engine causing issues.
    If I use the exact same source files to create a PDF using any of my other tools I have no issues. I checked the PDF versions made by the tools and they are all set to 1.5.
    A customer mentioned being able to convert them in a way they worked by saving them without having to do any kind of extraction, but I have not been able to duplicate that. Perhaps he did a "print" which seems like it could work.
    In summary, the workaround everyone is talking about, using an alternate reader, of course works. But not everyone wants to change.
     The culprit I have found is my Nuance PDF Creation tools that are using the ImageToPDF engine.
    I hope it gets FIXED as I really don't want to have to regenerate all of my PDF files.

  • How do you force itunes comments to ID3 tags in MP3 files?

    I have comments all throughout itunes. The mp3 files do not have those comments in the ID3 info.
    How do you force itunes comments to write out to ID3 tags in MP3 files?
    The folder and files all have write permission.

    Yeah, don't do that, you probably also degrade the sound quality... If you've confirmed it is something odd with multiple tags try this.
    Select a group of mp3 files (You might want to start with a smart playlist so you don't mess with any other format)
    Right-click and use Convert ID3 Tags > None (may need to repeat this step if multiple tags)
    Then right-click and use Convert ID3 Tags > v2.3 (v2.4 support still patchy from various accounts)
    Downside is that it will lose any embedded artwork, but it should preserve all other meta-data, both tag-based and stored within the library itself.
    In fact, if you use my CreateFolderArt script before and after updating the tags it should archive any artwork as a local Folder.jpg image for each album and then reinsert that image on the subsequent run... Check it out on a single album first. If it doesn't work as expected let me know and I'll tweak the script to achieve this end.
    tt2

  • I suddenly have this error message on FireFoxthis message pops up: "Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory. Please check that this directory has no re

    I suddenly encounter this error message from Fire Fox.
    Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory. Please check that this directory has no read/write restrictions and your hard disk is not full or close to full. It is recommended that you exit the application and fix the problem. If you continue to use this session, you might see incorrect application behaviour when accessing security features.
    I uninstalled the browser and download a new version but it does not resolve the issue.
    I know my hard disc has ample space. I do NOT know where to find the Profile directory to fix the read restriction box.
    == This happened ==
    Every time Firefox opened
    == After something about security add-on of Norton pop up by itself. ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; MSN Optimized;US)

    This link shows things to check - https://support.mozilla.com/kb/Could+not+initialize+the+browser+security+component

  • Problem in file content conversion from XML to CSV

    Hi Experts,
    I am finding problem in file content conversion. I need to convert the following XML file into CSV file:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_CROSS_REF xmlns:ns0="urn:dabur:idoc2file:pos">
          <Update_type>2</Update_type>
          <PLU>00000000</PLU>
          <Cross_ref_PLU>7777777</Cross_ref_PLU>
          <Capture_PLU />
          <Package_size />
          <Package_desc />
      </ns0:MT_CROSS_REF>
    The output file data has to be like:
    2,00000000,7777777,,,,
    The problem I am facing is while specifying the content conversion parameters in communication channel i dont know what recordset structure i should mention as all the records are directly under root. If I mention recordset structure as "ns0:MT_CROSS_REF" and parameters as
    ns0:MT_CROSS_REF.fieldSeparator   ,
    ns0:MT_CROSS_REF.endSeparator    'nl'
    i get error in communication channel monitoring and no file is posted.
    Please help me as to what correct parameter i should mention in my case.
    Thanks,
    Regards,
    Yash

    Hi Chirag,
    I cannot change the xml file as it comes after mapping idoc to a message type. How can I add ROOT in the xml? My message type is like MT_CROSS_REF and it has those 6 fields as in the XML (Update_type, PLU etc.). I do the mapping of these fields from a IDOC and get the XML.
    I hope you got my point.
    Thanks,
    Yash

  • I have problems transferring files from PC to Mac and from Mac to Mac

    I have problems transferring files from PC to Mac, and from Mac to Mac.  PC to PC is fine.  Nothing but problems with the Mac.  One example:
    While working on my PC, I open shared folders on an external HDD connected to the Mac.  I click on paste to move the files.  I get an error after a few seconds to a minute of trying to move several files from my PC Win 7 to Mac OS Maverick, that there is a file already at the destination on Mac. This statement is true, but it was just put there because I am copying them over in that same action.  It reads 0Kb and wasn't there before I started.  Then I get an error: The Action Cannot be completed because the folder is open in another program.  Close the folder or file and try again..
    Whether I click on it a bunch right of way or wait, it still takes about 45 seconds. I have to do it with every file and it only happens when copying from a PC to Mac.  I have even restarted both computers so nothing is using any files.  If I copy one file at a time, I don't get any error.
    So I have one file to move, no problem.  If move 5 files, The first will go fine, but it shows all 5 files in folder at once.  All other files than the first show 0kb. I get the file already existing error once it starts the second file transfer, and I select move and replace.  Then I get The Action Cannot be completed because the folder is open in another program.  I wait or click repeatedly until it starts to move file.  That file will then show something other than 0kb.  When it is done, the error process starts all over.  I tried checking the PC with unlocker, but the files do not show themselves locked on the PC.

    Its not only French. Even certain characters in English will come across as gobblydegook from 1 platform to another. I see this in emails that likely were composed in Word & the characters don't come across.
    Not sure if this is still true, but years ago someone explained that there is a standard character set & then I think its extended characters & those vary from platform to platform or language to language, etc.

  • Unable to download from AppStore, updates,etc.Messages 'the installer is damaged' to 'there might be a problem with file ownership and permissions.' I am the owner and only user of a new MBP. What could be going on?

    Is anyone having the same type of problems I'm having with Lion. I have a new MacBook Pro, received 7 weeks ago, preinstalled with Leopard 10.6.7. I didn't migrate anything from my old iMac, wanted a clean install from the Apple Store. While there, I asked for the upgrade to Lion 10.7, however their system was down.
    I  installed it myself, wirelessly about a week later, and Apple emailed me a receipt. Now, I've had to call support directly last week when I lost Mail, Address Book, was unable to open Preview or iTunes, among other problems. Seemed fixed after a session that baffled even the store tech.  Now I am unable to download or install the recent Mac updates for Lion, from the App Store, could not install Adobe Reader, etc. Messages range from 'A network error has occured - Check your Internet connection and try again' to 'The Installer is damaged and cannot open the package. There may be a problem with file ownership or permissions.'  All fail and I'll probably have to call Apple again. I am frustrated beyond words.  Logs 'Install's runner tool is not properly configured as a setuid tool', domain errors, 'attempt to write a readonly database, and on and on. I have barely done a thing on this computer except search online for help with these problems. Safari gives me a 'You are not connected to the internet' too often. Diagnostics disagrees. I do see wi-fi problems in the forum. Disk and permissions were fine at the beginning of the earlier problems, checked first by support tech. I'm not sure if support tech even knew. I was just happy they were fixed. Anyone have these download and/or install problems after a 'clean bill of health' so to speak, only a week ago?

    Let's try the following user tip with that one:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • Computer will not boot up on usb cd rom to repair windows problem (corrupt file) what should i do

    computer will not boot up on usb cd rom to repair windows problem (corrupt file) what should i do

    Which computer? Which Windows?
    What are you trying to do?
    -Jerry

Maybe you are looking for

  • Not able to clear an open line item using F-44

    Hi Experts,                  I am trying to clear  open line items of a document using F-44. But I am getting message "No appropriate line item is contained in this document". The open line item document is available in BSIK table also. Please help m

  • Problem opening PrE 9 project created on Mac in Windows

    Hi, I recently migrated from a Mac to Windows 7, and am having problems opening my project files on the Windows computer. I created several PrE9 projects on my Mac, but now I need to open some of these files on a PC with Windows 7. I get the error me

  • Why wont my ipod 4th generation not slide to unlock

      why wont my ipod 4th generation bot slide to unlock

  • End_date to be after than From_date

    Hi, I have to design a simple OAF page with two fields From_date and End_date which are to be input by the user.The requirement is that From_Date and End_date text boxes should have icon of calendar next to it(if it is possible) and the user should e

  • Error in EM console after silent install using response file

    Hi, I'm trying to install oracle 10g release 2 (10.2.0.1.0) on RHEL 5 using a response file by the silent installation method. The response file itself had been generated by running a normal GUI based installation along with the record option. The sa