Changing script from CS2 to CS4

Hi everyone!
Having a bit of a problem (not to mention working against a deadline) with an old CS2 script created for a client. ESTK throws up an "Undefined is not an object" error.
Below is the code that seems to be the culprit. ESTK stops on the line after the .place(), assuming here that it's because the .place() doesn't return a proper object or something like that (I hate when they change scripting around too much).
Basically, what it does is placing an image into the first paragraph of a table cell. It then tries to set the dimensions to a "maximum" size and then fits the image proportionally to those dimensions.
> tmpBild = "B0000843.jpg"; //temporary for testing
newTable.rows[newTable.bodyRowCount-1].cells[4].contents = "\r";
tmpPara = newTable.rows[newTable.bodyRowCount-1].cells[4].paragraphs.item(0);
tmpPara.justification = Justification.centerAlign;
tmpImg = tmpPara.place( PICBASE + tmpBild );
tmpImg.parent.visibleBounds = ["0mm","0mm","38.236mm","38.236mm"];
tmpImg.parent.geometricBounds = ["0mm","0mm","38.236mm","38.236mm"];
tmpImg.fit( FitOptions.proportionally );
tmpImg.parent.fit( FitOptions.frameToContent );
tmpImg.parent.strokeColor = "Paper";
tmpImg.parent.strokeAlignment = StrokeAlignment.centerAlignment;
tmpImg.parent.strokeWeight = "5pt";
tmpImg.parent.strokeType = app.strokeStyles.item("Thick - Thin");
Can anybody help convert this so it works for InDesign CS4? In the meantime, I will try to take care of the rest of the script.
Btw, I have/had a scripting
b reference
in PDF format for InDesign CS2, is there anywhere that I can download that for CS4, I know it was very helpful back then.

What I ended up doing was create roughly enough pages in the document and create linked text frames on all pages, thus letting the table created in the first text frame flow as long as the document has enough pages. In the end processing, I then remove all the pages but the first one, effectively getting one page with one text frame containing all table contents.
This was the only way I could find to get around this problem. No matter what I did, placing content into a table cell that was overflowing a text frame just didn't work.
Here's the part where I create the pages (variable myMaxPages contains your estimated maximum number of pages). Please note in app.documents.add() that it is set to false to NOT open a window (speeds it up very slightly if you have a huge number of pages). You can remove the false and the myDocument.windows.add() statement if you don't want this or for debug purposes. The formatting mechanism on these forums seem broken, but the following code should be ok/readable once properly formatted.
>myDocument = app.documents.add( false );
with(myDocument) {
for( i = 0; i < myMaxPages; i++ ) {
myPage = pages.item(i);
with(myPage) {
if( i > 0 ) { myPrevFrame = myTextFrame; }
myTextFrame = textFrames.add();
with( myTextFrame ) {
if( i == 0 ) {
myTable = tables.add();
with( myTable ) {
bodyRowCount = 1;
columnCount = 5;
} else {
if( i > 0 ) { previousTextFrame = myPrevFrame; }
if( i < myMaxPages - 1 ) {
pages.add();
myDocument.windows.add();
While fiddling with it, I also updated my image placement code a bit:
> var myCell = myTable.rows[myTable.bodyRowCount-1].cells[4];
myCell.contents = "\r";
myCell.paragraphs.item(0).justification = Justification.centerAlign;
var myRect = myCell.insertionPoints[0].textFrames.add();
myRect.contentType = ContentType.unassigned;
myRect.visibleBounds = ["0mm","0mm","38.236mm","38.236mm"];
myRect.geometricBounds = ["0mm","0mm","38.236mm","38.236mm"];
var myFile = File(PICBASE + tmpBild);
if( myFile.exists ) {
var myImage = myRect.place( myFile );
myRect.fit( FitOptions.proportionally );
myRect.fit( FitOptions.frameToContent );
Maybe this helps someone, maybe it doesn't. Can't say that I'm happy with the behaviour of getting errors and being unable to place content in table cells that is overflowing out of a text frame, but I needed to solve it, and this is how I did it.
Of course, if anyone else has a better solution to placing images into table cells that may be in the overflowing part of a text frame, go ahead and share with the rest of us, please.

Similar Messages

  • Updating a Script from CS2 to CS4

    My client has a script written for CS2 (PC). They want me to quote the job it is used in (it's a series of scripts to help move their copy to the web, basically, so it tags and collects XML to work with their site), and if I'm to quote it, I'll want to do the job in CS 4, Mac platform. The scriptwriter who wrote it will not respond to me, so I'm looking for A) an understanding of how much work this is going to be, i.e. about what it's going to cost me to have updated and the platform changed, and B) where I find a script writer to do this for me. I'm not sure I'm intererested in learning enough about script writing to mess with these scripts myself, although certainly I know it's just one more thing I really ought to learn to do.

    Hi Kayle,
    I'm interested in the job.
    It's difficult for me to quote my price without seeing the files and knowing all your requirements. So, I'd like to leave this to your discretion.
    I'm ready to start tomorrow, if scripts written in JavaScript suit you. But I will be able to test them on CS4 Mac only starting from Wednesday when I get to work. I have only CS3 at home, but there's no big difference between CS3 and 4 as far as scripting concerns, so I can start it on CS3.
    Kasyan

  • Dictionary transfer from CS2 to CS4

    Hi, all.
    I've built up quite a specialized dictionary in CS2. Now, our company is going to CS4. Will my CS2 dictionary transfer over, and if so, how?
    I appreciate any help.
    Best wishes,
    Michael
    Michael E. Bakich
    Senior Editor/Photo Editor, ASTRONOMY magazine
    21027 Crossroads Circle
    Waukesha, WI 53186
    [t] 262.796.8776  x433
    [e] [email protected]

    Hi Michael,
    Honestly I don't know if the custom dictionary files changed format or anything from CS2 to CS4.  When you get CS4, try linking to it from Preferences > Dictionary.
    If you're saying though that you're not working with an auxiliary custom dictionary, and instead have added/removed words from your User Dictionary (the default one), then my best guess is you're going to lose those. So, don't uninstall CS2 yet ... boot the program, go to Edit > Spelling > Dictionary, and export the words you see in Added Words. (Maybe also in Removed and Ignored Words). There's an Export button there.
    Then when you install CS4, if the dictionary was overwritten, you could always go back to that Dictionary dialog box and click the Import button to bring the added words back in.
    AM

  • Upgrading from CS2 to CS4

    I've upgraded from CS2 to CS4 on my WindowsXP, and my question is, can i now safely remove CS2 from my program roster without impacting any of my CS4 applications?

    If you're low on disk space, uninstalling CS2 will accomplish NOTHING. If you've reached this point, you need a new harrdrive.
    Working with a system drive with under 20% free space is a disaster waiting to happen.
    Bob

  • Can I upgrade from CS2 to CS4 and skip CS3?

    Can I upgrade from CS2 to CS4 and skip CS3? It would save me time.

    Colin,
    >But I did exactly what everyone on here said they did, went onto adobe.com to do our research, saw that the upgrade works from CS2-CS4
    Adobe shows there are multiple versions of the suites on their site and clearly points the way for purchasing at the Adobe Store. Just for the heck of it, I also went to MacMall.com and MacConnection.com, two well-known online resellers. I checked their Adobe CS4 upgrades, and they clearly indicate which older versions they are meant to go with. Not quite so clear from MacZone.com and a few other reseller sites I visited.
    >I am an IT person for a printing company, and as such I spent hours upon hours preparing for this transition.
    It took me just a few minutes to find the correct version I needed.
    >no one can tell the difference, and most vendors don't know it exists. We could help you, but you didn't buy it from us."
    Maybe the reseller you bought from is just sloppy and didn't mark the SKUs properly. But how is this Adobe's fault -- particularly when other vendors can and DO get it right?
    Also as both Mac and Win upgrades are pretty much determined and marketed the same way, what does this sloppiness have to do with Mac market share?
    But that said, there is enough good information on the Adobe site that should trigger some questions if you as the IT guy have any doubts and are responsible for buying for your company. At the least, doesn't it make sense to call Adobe and ask which SKUs you should buy? It could've saved hours of research time.
    If you truly did your research and purchasing carefully and were still fooled, I suggest you start with a complaint to the reseller who sold you the goods.
    Neil

  • Upgrade from CS2 to CS4?

    I work for a legal education company and our Composition Department currently uses CS2 InDesign for our manual and brochure production.
    We use the Data Merge functions in InDesign for every marketing piece created, as well as scripting. The majority of our product is mass-produced, quick turn-around mailings, with occasional individual pieces for specific programs.
    Our mauals are created from materials submitted by faculty members for each program. These are converted to PDF or scanned and compiled in Acrobat; with the cover, title pages and table of contents created in InDesign.
    I use the entire CS2 suite for all of our other printed media and web design components, as well as individual creative pieces for partners.
    We are discussing upgrading and I was wondering if anyone could tell me if there are any new and fantastic time-savers that I can research to see if they would suit our purposes before I write my proposal. Anything you have used and liked/disliked? New features that have cut times down?
    We operate on PCs, not Macs, incase that will make a difference in your thoughts.

    Here's my top 10 for InDesign: http://theindesignguy.com/cs4-thoughts.shtml
    Keep in mind that those are my top 10 from CS3 to CS4. It doesn't even touch on the new CS3 features.
    Bob

  • Use Preferences from CS2 in CS4?

    I have deleted CS2 and installed CS4.
    How can I use my preferences from CS2?  I hate the thought of trying to reconstruct my actions, function keys, menu colors, etc.

    First of all, regrettably there is no adobe warning other than here and in various obscure Tech notes about the advisability of saving the panoply of brushes, actions, plug-ins and preferences that many users accumulate during their use of Photoshop. It seems you have to learn by bitter experience.
    Third party plug-ins should always be kept in a separate folder, identified in preferences. Actions and brushes should be saved in sets and backed up along with any styles, presets, and such like.
    The whole folder containing a "good"set of preferences should also be backed up.
    All this makes life easier if you have to re-install or, as in your case, upgrade.  The only help adobe gives is a warning during the uninstall process about shared files.
    Regarding your questions, if you saved any of the above, they may be still on disk or on your image backup, and can be loaded into the new version. However I am pretty sure most of the preferences (psp files) will not be applicable to CS4 anyway.
    Re-installing CS2 will obviously not bring back your personal items (although you will need the disk for the upgrade).
    Rebuilding preferences from the edit menu in a new version only takes a few minutes and is essential in CS4 owing to the many changes. Also, even if you manage to locate and reload the other things mentioned, be prepared to find a lot won't work.
    Sorry for the long answer – I hope some of it helps!

  • New hard drive, reinstall upgrade from CS2 to CS4 Question

    Hi,
    I upgraded my CS2 to CS4 Extended early this year, my hard drive just bit the dust and I have to re-install the CS4, will I have to call customer service again to get my copy of CS4 Extended activated, again?
    Thanks, Charles Grubbs / futurexboy

    Like you, I've completely recovered from a hard drive failure - one of two in a RAID 0 arrangement in my case.  Windows Backup restored it completely, likewise without re-registration, etc.  A key difference is Windows Backup runs for me late at night, in a set-it-and-forget-it fashion (my computers stay on 24/7).  I don't have to boot up a separate system to run it.
    But I don't doubt Image is a good product.
    It's good to have good alternatives to choose from.
    -Noel

  • Transferring actions from CS2 to CS4

    I recently upgraded from Photoshop CS2 to CS4.  Can anyone tell me how to transfer the actions I created in CS2 to CS4?  I use a mac.

    Save them from the flyout menu in the top right corner of the Actions palette in CS2, then load them into CS4.
    Mylenium

  • Can someone assist me in upgrading from CS2 to CS4 PC version?

    I have loaded the CS2 version on my PC and now I want to upgrade to CS4 master using the upgrade version.  I have serial numbers for both versions but when I tried to load the CS4 upgrade, the system said it could not find the old version.  I had to input the serial number of the software I was upgrading from but CS4 only gave me two version options, CS3 and CS3 upgrade.  When I input the serial number of my CS2 version, the system said this is not a CS3 serial number.  So I proceeded to install CS4 as a trial version thinking I can later input the CS2 serial number.  Unfortunately my CS4 upgrade install ran into issues and did not install all of the main software (photoshop, illustrator, etc).  I tried to reload CS4 but ran into the same errors.  So now I have two issues, one is how do I get the system to take the CS2 upgrade and how do I fix the install issues so the full CS4 programs will load.  Please help.

    Troyboy8998 please contact our support team to verify the validity of your upgrade.  For the best assistance, I recommend our chat support at http://adobe.ly/yxj0t6.  Our chat representatives can provide a personalized experience to resolve the issue you have described.

  • From CS2 to CS4 and from 32-bit to 64-bit

    This might make some of you laugh but i upgraded from Ps CS2 full version which is 32-bit to CS4 and i want to install my upgrade CS4 on a new Vista 64-bit system. Will this enable my upgrade to run as 64-bit? Or do i have to buy the full version of CS4 in order to have it run as 64-bit?

    Personally,I don't think is a strange question, mainly because I will be in the same position soon. If I understand correctly, you are concerned that you wont be able to install CS4 64bit if you have to install CS2 first. Is that correct?
    If so, I'm in the same boat. I assume that it will be possible as it is possible to run CS2 in 64bit mode.

  • Importing Keywords from CS2 to CS4

    I notice in CS4 Extended (Trial) that one can import Keywords. I still have CS2 will all it's files on the same system and was wondering what the name of the CS2 file is that I can import existing Keywords from.
    Thank you!

    Personally,I don't think is a strange question, mainly because I will be in the same position soon. If I understand correctly, you are concerned that you wont be able to install CS4 64bit if you have to install CS2 first. Is that correct?
    If so, I'm in the same boat. I assume that it will be possible as it is possible to run CS2 in 64bit mode.

  • Specific Colour changing Script from RGB to CMYK

    I need to change the RGB values (imported from word) to specific CMYK values in Indesign (its not a straight swop) so I need a script or a similar plug-in that enables me to input the colour values for the CMYK so they automatically change.... the doc i work on is huge and im importing from a word file many times so i need to save time!!
    Can anyone help me?
    Thank you!

    Hi Phil... Hmmm not sure if i explained myself! Or maybe I am being thick.... I tried the new code but im not sure I was clear on my problem?
    This is the current code i use to change the RGN values to the CMYK is: I have entered the RGB and CMYK values as they need to be changed and it works but the swatch pallette ends up looking messy! See below.
    var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R122_G75_B153"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[48,72,0,0];
                     mySwatch[j].name = "C=" + myCV[48] + " M=" + myCV[72] +" Y=" + myCV[0] + " K=" + myCV[0];
             }catch(e){alert(e)}
    var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R255_G0_B255"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[0,100,0,0];
                     mySwatch[j].name = "C=" + myCV[0] + " M=" + myCV[100] +" Y=" + myCV[0] + " K=" + myCV[0];
             }catch(e){alert(e)}
      var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R0_G0_B255"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[100,0,0,0];
                     mySwatch[j].name = "C=" + myCV[100] + " M=" + myCV[0] +" Y=" + myCV[0] + " K=" + myCV[0];
             }catch(e){alert(e)}
      var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R255_G255_B255"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[0,0,0,0];
                     mySwatch[j].name = "C=" + myCV[0] + " M=" + myCV[0] +" Y=" + myCV[0] + " K=" + myCV[0];
             }catch(e){alert(e)}
      var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R0_G0_B0"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[0,0,0,100];
                     mySwatch[j].name = "C=" + myCV[0] + " M=" + myCV[100] +" Y=" + myCV[0] + " K=" + myCV[100];
             }catch(e){alert(e)}
      var myIDOc = app.activeDocument;
    var mySwatch = myIDOc.swatches;
    for (var j=4; j<mySwatch.length; j++){
        try{
             if(mySwatch[j].space ==ColorSpace.RGB){
                 if(mySwatch[j].name=="Word_R234_G229_B255"){// may be this is correct you can check the indesign swatches name
                     mySwatch[j].model=ColorModel.PROCESS;
                     mySwatch[j].space = ColorSpace.CMYK;
                     var myCV = mySwatch[j].colorValue=[8,10,0,0];
                     mySwatch[j].name = "C=" + myCV[8] + " M=" + myCV[10] +" Y=" + myCV[0] + " K=" + myCV[0];
             }catch(e){alert(e)}
    The outcome is the swatch pallette attached:
    How do I incorporate the new code to make sure all the values are hopefully to end up looking similar to this!!??
    Thanks for all your time and effort helping me!
    babeanz

  • Problem loading styles from CS2 to CS4

    I just upgraded to InDesign CS4. When I open a file I created in CS2, none of the object styles I defined in that document are available. I tried to load the object styles from CS4 (pointing to the CS2 file that contains the styles), but it brings only 1 of about 15 styles across. In addition, the only style that comes across is now grayed out, so I can't apply it anyway. Has anyone else had this happen?
    Thanks.
    Brian

    Personally,I don't think is a strange question, mainly because I will be in the same position soon. If I understand correctly, you are concerned that you wont be able to install CS4 64bit if you have to install CS2 first. Is that correct?
    If so, I'm in the same boat. I assume that it will be possible as it is possible to run CS2 in 64bit mode.

  • Upgrade from CS2 to CS4, Should I?

    I am down to the last day to take advantage of the discounted price on CS4.  I currently have CS2 and would like to hear your opinions on whether or not I should upgrade, pros/cons, and issues regarding installation.  I am running Vista Ultimate 64bit with 4GB memory with my CS2 now with no performance issues.  Thanks in advance.

    Provided the video card meets the requirements for CS4 (see below), I would definitely go for it.
    There are a lot of improvements.
    1,024x768 display (1,280x800 recommended) with 16-bit video card
    Some GPU-accelerated features require graphics support for Shader Model 3.0 and OpenGL 2.0

Maybe you are looking for