Page 1 of 1

update filename of images

Posted: Sat Jul 04, 2009 10:29 pm
by jmburnod
Hi All,

I copy a stack on an other computer (from iMac intel Core Duo OSX 10.5.6 to PowerBook G4 10.4.2)

I watch the filename or images are updated automatically but if the image is in a group my stack keep the old filename.

Do you watch the same ?

Best regards

Jean-Marc

update filename of images

Posted: Sat Jul 04, 2009 11:35 pm
by jmburnod
I'm sorry,

i forget i write a script for update filename of a list of images.

Regards

Jean-Marc

Posted: Sun Jul 05, 2009 7:05 am
by shadowslash
Hi jmburnod,

I think it would be much easier to understand what your problem is if you post a portion of your code here. Image

update filename of images

Posted: Sun Jul 05, 2009 10:06 am
by jmburnod
Hi Shadowslash,

Thank you for support

This script to update a filename work :

Code: Select all

function fChgPathNec pFi  -- (pFi is the filename to update)
   put empty into rfChgPathNec
   put "LeNecessaire" into MonSubFol
   put the filename of this stack into MyPathS
   put the itemdel into myOID
   set the itemdel to "/"
   put the num of items of MyPathS into nbD
   put the num of items of pFi into nbO
   put item 1 to nbD-1 of MyPathS into MyPathFolD
   put itemOffset(MonSubFol,pFi) into bufOffNec
   put item bufOffNec to nbO  of pFi into bufPathKeep
   set the itemdel to  myOID
   put MyPathFolD&"/"&bufPathKeep into rfChgPathNec
   return rfChgPathNec
end fChgPathNec
All the best

Jean-Marc

Posted: Tue Jul 07, 2009 4:45 pm
by Bernard
Hi Jean-Marc

Let me restate your problem (as I understand it). You are trying to change the filenames of image controls in your stack. The function you listed is what you use to produce the new file path & name. This script works, but not if the image is in a group.

Is that correct?

I just called the function listed here, and when I passed it a file path & name, the path returned by your function was invalid (it contained "//" at one place instead of "/").

Bernard

Posted: Wed Jul 08, 2009 10:58 pm
by jmburnod
Hi Bernard,

Thank for this feed-back
Let me restate your problem (as I understand it). You are trying to change the filenames of image controls in your stack
This script works, but not if the image is in a group.
Is that correct?
Yes, you understand me
No. I tested it now and it work also with an image of a group
I just called the function listed here, and when I passed it a file path & name, the path returned by your function was invalid (it contained "//" at one place instead of "/").
I dont have a double "/" [/quote]
Maeby it is because you haven't a subfolder "LeNecessaire" in the folder it contains the stack (it define the part of path to keep)

Jean-Marc