4 Replies Latest reply on Mar 13, 2010 4:31 PM by John Hawkinson

    can anyone HELP with a couple of issues with our script please?!


      Hi everyone


      We have a JavaScript which was commissioned a while ago to batch rename and relink the images files paced in an inDesign publication.


      It's a great tool and has porved invaluable to us svaing hours and hours we used to spend ensuring the graphics meet the naming conventions designated by our various clients.


      My first issue is that it ran on CS4 fine until we installed the latest update to 6.0.4. It's fine prior to that and consequently we have one mac which is not updated and everyone fights over!


      My second issue is that the script has been set up to adjust the file names to JOBNAMEORNUMBER_P001a.ext the problem being we are now starting to find clients would like the name to be truncated slightly, excluding the underscore and p for page i.e. JOBNAMORNUMBER001a.ext.


      I've been hijacking old threads with similar issue and I've tried every script I have found posted in these and none of them work, they either name one image at a time (something we can do almost as quickly via the adobe dialog or using bridge) or they produce errors.


      We are all completely in the dark when it comes to Javascript so I'm not even sure if I'm running these correctly but as our need sseem fairly simple I'm hoping we'll be able to adapt our working script ourselves?


      I'd love to show you the script but whoever made it saved it as a JSXBIN (binary?) file and I have no idea how to read it!


      If you can help I'd really appreciate it!!


      Thanks in advance


        • 1. Re: can anyone HELP with a couple of issues with our script please?!
          John Hawkinson Level 5

          If you only have a JSXBIN file, you are basically screwed. Go back to the person who wrote the script and demand the source. Or re-

          commission the entire script based on your detailed requirements and accept the cost of a valuable lesson --

          always get the source code.


          It's probably theoretically possible to get the script out of the JSXBIN file, but it's not published how to do it, and the few people who know how probably arne't talking. It's not something you're supposed to be able to do.


          There were some minor changes to the scripting model in 6.0.4; they're trivial to correct in the source code, but without it, no dice. (Adobe isn't supposed to do things like that...I think it's acknowledged as a mistake. Though it seems unlikely they'll fix it the other way for 6.0.5, but you could always hope, pray, send large chocolate cakes and bottles of wine addressed to "InDesign Scripting Team; Adobe Systems; 345 Park Avenue, San Jose, CA". I have no idea if the InDesign team is in San Jose, Mountain View, San Francisco, or some other random Adobe office...).


          Why don't you move your machines back to 6.0.3?


          I suppose we could easily give you a script to go through all the links in your document and remove _P from filenames.

          You would want the script to rename the files in the filesystem as well as the links to them in the document?


          If the script isn't too-too detailed, we could probably rewrite the whole thing for you here. But you'd need to supply very detailed requirements and examples. A lot more clarity than you have provided so far...

          1 person found this helpful
          • 2. Re: can anyone HELP with a couple of issues with our script please?!
            amy_emcdesign Level 1

            Hi John,


            Oh dear that does sound a bit hopeless,


            My problem is that a client gave me the script but I don’t have any current work with them and they won’t provide it for me to use on competitors work.

            What I’d really like to do is customize it and make the script my own, something I can update and grow as InDesign moves forwards, but as it's now 'bin' it sounds like I may as well 'bin' it!


            As for our requirements (and what it did do) is to rename all the linked graphics in the publication and repair the links at the same time (lord knows how it worked and I can't find anything that does this in exisitng scripts and plug ins, unless they are for PC or for Quark).


            It asked for a job name (which we generally call the ISBN of the publication), it then calls all the files ISBN_P and follows this with the page number and location on the page alphabetically.


            The final images are called




            1234_P002a etc


            as you can imagine, our alternative is to use the Adobe dialogue to insert the job name, and work out for ourselves the page and location - leaving lots of room for user error as there are on average 100 linked files in each chapter, say 5 per page. The other option is to rename them using a batch renaming software, but then re-link them manually. Either way is very time consuming and leaves room for lots of mistakes.


            We can't use inDesign without the update as some of the features which were a problem with 6.0.3 are key to our work, also our clients insist we use current software so we need a more long term solution.


            I'm at a point where I think I might start learning Java from the beginning until I can write the code myself. I don't know where to start with commissioning the script. I was really hoping it would be something I could resolve myself


            All the best


            • 3. Re: can anyone HELP with a couple of issues with our script please?!
              amy_emcdesign Level 1

              to clarify a bit more...


              The error we're getting when a file uses the same link more than once is: error number 55 'Object does not support the property or method 'name''


              When I talk about the multiple images - what the old script did was run, and then when it hit an image placed more than once, the script's window came up with 'image used multiple times in document, please insert a generic name' (or something similar but worded better!).


              Then in the window to insert text, the existing file name was displayed and it gave you the opportunity to re-key something more fitting with the naming convention.


              So for example it might have been called 'listening icon.ai' and the job naming convention is 'JOBNO_P001a'... etc,. We can't have the image to be physically duplicated for each occurence in the job (sometimes in the hundreds) and then renamed. It also makes no sense for us for it to be named according to it's first occurence. So we would like to be given the option to call this file 'JOBNO_LISICON.ai' or something generic.



              • 4. Re: can anyone HELP with a couple of issues with our script please?!
                John Hawkinson Level 5

                Please see my reply in the other thread. It would be helpful and much less confusing if all the followups went in one thread (the other one -- since it has the scripts).