4 Replies Latest reply on Dec 16, 2009 2:16 PM by bryancolley

    Error: Can't get every item of...

    bryancolley

      I have a script that worked find in Tiger but it gives me an error
      after I upgraded to Leopard 10.5.8.  I'm not sure how to fix it.

      The script is supposed to make a list of dates that I can choose from.


      Here it is:

       

                      repeat with curyear in myyear
                               repeat with curmonth in mymonth
                                       repeat with curdate in mydate
                                               set mytemp to curmonth & " " & curdate & ", " & curyear
                                               set myjournal to (every item of myjournal) & mytemp
                                       end repeat
                               end repeat
                       end repeat

       

      But now I get an error saying:

       

      "Can’t get every item of \"\"."

       

      Help please!

        • 1. Re: Error: Can't get every item of...
          sstanleyau Level 4

          You're not showing the full script, so it's impossible to tell. Where is the error happening? Where does myjournal come from?

          • 2. Re: Error: Can't get every item of...
            bryancolley Level 1

            Sorry about that. Here's the complete script. It should come up with a list

            of dates to choose from.

             

             

            tell application "Adobe InDesign CS2"

                    activate

                    set mydoc to active document

                    set myjournal to ""

                    set myyear to {2009, 2010}

                    set mymonth to {"January", "February", "March", "April", "May",

            "June", "July", "August", "September", "October", "November", "December"}

                    set mydate to {1, 15}

             

                    repeat with curyear in myyear

                        repeat with curmonth in mymonth

                            repeat with curdate in mydate

                                set mytemp to curmonth & " " & curdate & ", " & curyear

                                set myjournal to (every item of myjournal) & mytemp

                            end repeat

                        end repeat

                    end repeat

             

                    set mypick to (choose from list myjournal) as string

                    display dialog mypick

            end tell

             

             

            Bryan Colley

            jupiterkansas@gmail.com

            • 3. Re: Error: Can't get every item of...
              sstanleyau Level 4

              You still haven't said where you're getting the error -- it works here.

               

              Try changing:

               

                      set myjournal to ""

              to
                      set myjournal to {}
              and:
                               set myjournal to (every item of myjournal) & mytemp
              to
                               set end of myjournal to  mytemp

              • 4. Re: Error: Can't get every item of...
                bryancolley Level 1

                The error came with the

                 

                     set myjournal to (every item of myjournal) & mytemp

                 

                line, but your suggestions totally fixed everything. I can't thank you

                enough!

                 

                 

                Bryan Colley

                jupiterkansas@gmail.com