replace text in url field

Thomas J McGrath III 3mcgrath at adelphia.net
Thu Jan 8 16:14:52 EST 2004


Hi Bob,

I don't remember but I do know you can take the original name apart and 
add your own name to it.

This is not real code syntax but shows the idea:

put (name of folder) into myfolderVar
fix the directory to this one
load the directory  files into mydirVar
now you have name of folder and list of files
now
repeat with x = 1 to num lines of mydirVar
delete char 1 to ? of line x of mydirVar
put "Image"& x  before line x of mydirVar
end repeat
now you have a new name for each image based on the number of lines.

you could put the num lines into a global and add to that for the x 
naming
or you could put a time or special name to each image

Or in your case
you might just want to use the same name and the "if there is a" to 
check the file already exists and if so add a 1 to it and if that 
exists than add a 2 etc. this is a lot less coding and then you can 
ignore all of the other issues.
1raw***.pic
2raw***.pic
etc.
  or add the long time before each with no punctuation in it
31801raw***.pic

OR even better
set the twelveHourTime to false
put the dateTime into mytime
set the twelveHourTime to true

put mytime before line x of myDirVar

now each item should??? be different

There may be an even better way???

Tom

On Jan 8, 2004, at 12:37 PM, Bob Hartley wrote:

> At 16:58 08/01/2004, you wrote:
>
> Hi tom
>
> I'll have a look at rev for the code and learn how this one works
>
> from first impression it looks like your script will name the images 
> sequentially.
>
> I need it to retain the directory name in the file name.
>
> I now remember that I saw a script that had something like replace 
> "raw" with \name. OK I'm lost here but I hope you get the meaning. It 
> may also have been replace with characters between \&\.
>
> Does that ring a bell?
>
> I'm not with it today. :-)
>
> Cheers
> Bob in the lab
>> I do this in my preOpenCard.
>> I get the default directory then put my own path into it - afterwards 
>> I put the default back.
>> I then get a list of the available images.
>> I then replace parts I need and sort the field and then put back 
>> parts. But you could do any kind of renaming with maybe a global that 
>> has the last name used so none over lap.
>> in preopencard
>> -snip-
>>    put the directory into altdir
>>     put defaultFolder & "/media/31i/" into the_path
>>     set the directory to the_path
>>     put the files into theimages
>>     set the directory to altdir
>>
>>   if char 1 of line 1 of theimages = "." then delete line 1 of 
>> theimages -- .dsstore on mac
>>   repeat with c = 1 to the number of lines in theimages
>>     delete char 1 to 5 of line c of theimages
>>   end repeat
>>   sort lines of theimages numeric
>>   repeat with c = 1 to the number of lines in theimages
>>     put "Slide" before line c of theimages -- you could put anything 
>> here including another repeat with accumulating numbers
>>   end repeat
>>
>> -snip-
>>
>>
>> On Jan 8, 2004, at 9:37 AM, Bob Hartley wrote:
>>
>>>  files bob_raw01.pic 02.pic and 03.pic. My app lists the files and 
>>> allows me to transfer them. It works great.
>>>
>>
>> Macintosh PowerBook G-4 OSX 10.3.1, OS 9.2.2, 1.25 GHz, 512MB RAM, 
>> Rev 2.1.2
>>
>>
>> Advanced Media Group
>> Thomas J McGrath III    • 2003 •        3mcgrath at adelphia.net
>> 220 Drake Road, Bethel Park, PA 15102
>>
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>

Macintosh PowerBook G-4 OSX 10.3.1, OS 9.2.2, 1.25 GHz, 512MB RAM, Rev 
2.1.2


Advanced Media Group
Thomas J McGrath III	• 2003 •	3mcgrath at adelphia.net
220 Drake Road, Bethel Park, PA 15102





More information about the use-livecode mailing list