Page 1 of 1

from a mainstack to substack of an other mainstack

Posted: Mon Jun 14, 2010 5:29 pm
by jmburnod
I have a substack "LeMagasin" in a mainstack "MyMainstack" and an other mainstack "AllImages"

The stack "AllImages" contains one cd with 36 images

The substack "LeMagasin" contains 36 cds with one image in each cds

I need to set the text of image 1 of each cd of substack "Lemagasin" to the text of img n (n=1 to 36) of stack "AllImages"

This script dont work i have one error :
Error description: Chunk: no such object

I'm sur it is possible to do that more simple

Thank in advance for your help

Jean-Marc

Code: Select all

on ImpImDeOld
   global MonStack,MagStack,LeStack,gDev   
   put empty into gDev
   set the lockmessages to true
   put "MagImagesEtRef" into LaCD
   put the filename of this stack into MonStack
   put "LeMagasin" into MagStack
   answer file "Importer de :"
   if it = empty then 
      exit ImpImDeOld
   end if
   put it into LeStack --•• i select the stack  "AllImages"
   
   open inv cd  LaCD of stack leStack
   put the num of images of cd  LaCD of stack leStack into nb
   repeat with i = 1 to nb
      put the short name of img i of cd LaCD of stack LeStack into bufLeNom
      put SansSuffixe(bufLeNom) into LaCDdest
      put LaCDdest&return after gdev
      
      --All ways return one error message : Chunk: no such object without comment
      
      -- set the text of img 1 of cd LaCDdest of stack MagStack of stack MonStack to the text of img LeNom of cd LaCD of stack leStack
      -- set the text of img 1 of cd LaCDdest of stack MagStack  to the text of img LeNom of cd LaCD of stack leStack
      put the text of img LeNom of cd LaCD of stack leStack into vTextIm
      open stack MonStack
      open cd LaCDdest of stack MagStack
      set the text of img 1 of cd LaCDdest of stack MagStack to  vTextIm
      wait 2 milliseconds with messages
      --•• All ways return one error message END
   end repeat
      set the lockmessages to false
end ImpImDeOld

Re: from a mainstack to substack of an other mainstack

Posted: Wed Jun 16, 2010 9:25 am
by Mark
Hi Jean-Marc,

The following should work:

Code: Select all

on ImpImDeOld
  go inv stack "path/to/stack/AllImages.rev"
  repeat with n = 1 to 36
    set the text of img 1 of cd n of stack "LeMagasin" to the text of img n of cd 1 of stack "AllImages"
  end repeat
end ImpImDeOld
If it doesn't, please post the exact error message here.

Best,

Mark

Re: from a mainstack to substack of an other mainstack

Posted: Wed Jun 16, 2010 6:32 pm
by jmburnod
Hi Mark,
Thank for reply

I'm sorry, the problem is resolved (an error of me at "put the text of img LeNom" instead "put the text of img i")

Best

Jean-Marc