Re: Help! Need an AppleScript in a hurry! (Create text files based on file names)
Re: Help! Need an AppleScript in a hurry! (Create text files based on file names)
- Subject: Re: Help! Need an AppleScript in a hurry! (Create text files based on file names)
- From: Dave Balderstone <email@hidden>
- Date: Sat, 20 Dec 2003 20:07:02 -0600
Oops. The script I sent just creates the file, doesn't write to it.
Try this...
--
tell application "Finder"
set the_Folder to choose folder
set the_Files to list folder the_Folder without invisibles
set File_Num to count of the_Files
repeat with i from 1 to File_Num
set The_Name to item i of the_Files
set the_file_path to the_Folder & The_Name & ".txt" as text
try
close access file the_file_path
end try
open for access file the_file_path with write permission
write The_Name to file the_file_path starting at eof
close access file the_file_path
end repeat
end tell
--
Note that if the text file exists the script will create a new one by
appending ".txt" to it. I'll leave sorting that out to you. It's pretty
straight forward.
Good luck with your client.
djb
"Quando Omni Flunkus Moritati"
_______________________________________________
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.