New topic: 

Rename files with FolderItem

<http://forums.realsoftware.com/viewtopic.php?t=32250>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       serd83           Post subject: Rename files with 
FolderItemPosted: Fri Jan 29, 2010 4:56 pm                        
Joined: Thu Feb 22, 2007 7:08 pm
Posts: 858              I have a text file with 522 lines and folder with 522 
pictures. When I try to rename the picture in the folder the files name are not 
correct.
This works for example correct:
Code:for i as integer = 0 to 522
  listbox1.addrow str(i)
next

dim f2 as folderitem = desktopfolder.child("Pictures")
for i as integer = 0 to listbox1.listcount-1
  f2.item(i).name = listbox1.list(i)+".jpg"
next


But when I add the lines from the text file into a listbox and then rename the 
folder "Pictures" the most files name in the "Pictures" folder are wrong:
Code:dim f as folderitem = desktopfolder.child("text.txt")
dim t as textinputstream = f.openastextfile
while t.eof = false
  listbox1.addrow t.readline
wend

dim f2 as folderitem = desktopfolder.child("Pictures")
for i as integer = 0 to listbox1.listcount-1
  f2.item(i).name = listbox1.list(i)+".jpg"
next
   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to