NewbieQ: How to loop properly?
NewbieQ: How to loop properly?
- Subject: NewbieQ: How to loop properly?
- From: Leif Skoog <email@hidden>
- Date: Tue, 5 Mar 2002 13:43:29 +0100
I would very much like to animate a movie with picts converted to ascii
images. Firstly I have to make the textfiles.
What I want to do is to make Pict2Ascii open a series of pict-files in
a folder and process them one by one and save them as text files in
another folder.
The script I am working on doesn't allow me to get access to the files
in the loop because, I think, I only have the number of the loop and
not the filename.
It works when I make a prompt with "choose file" and "choose file
name", though.
Script is as follows:
on run
tell application "Finder"
activate
get the name of every file of the folder "Banzai:Desktop
Folder:Asciimovie:Picts"
set the fileList to the result
repeat with i from the first item in the fileList to the last
item of the fileList
set thisItem to item i of the fileList
tell application "Pict2AsciiFAT 1.03"
activate
set font to "Monaco"
set font size to 5
set auto contrast to true
set optimize for printer to false
set allow high ASCII to true
--here i tried to get hold of the fileName with "set
fileName to thisItem".
--Didn't work I can tell you ;). But the following does:
set theFile to choose file of type "PICT" with prompt
"Please choose a Pict file :"
set theString to convert picture to ASCII theFile
set outFilename to choose file name with prompt "Save
converted picture as :"
set outFile to open for access outFilename with write permission
write theString to outFile
close access outFile
end tell
end repeat
end tell
end run
Am I a hopeless jerk or what.
Help me, please
Leif
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.