Help! Need an AppleScript in a hurry! (Create text files based on file names)
Help! Need an AppleScript in a hurry! (Create text files based on file names)
- Subject: Help! Need an AppleScript in a hurry! (Create text files based on file names)
- From: <email@hidden>
- Date: Sat, 20 Dec 2003 18:27:21 -0500 (EST)
I need the help of an AppleScript artist. I'm afraid there's no money in
this little project, but might be able to set up a paying job in the
future if I can keep the client I'm doing this thing for. Bill Cheeseman
has done me the favor of outlining exactly how the Script would run, but
doesn't have the time to write it himself. My query and his reply follows:
on 2003-12-20 5:44 PM, email@hidden at
email@hidden wrote:
>
Hi! Just found your Web site through Google. I have a project that
>
needs to be completed tomorrow. It involves creating 120 text files
>
containing the names of 120 image files. I am of course desperately
>
searching for an AppleScript that can do the job for me. Do you know
>
where I could find one? To be more exact, what it needs to do is read
>
the names of files in a given folder and for each one create a text
>
file containing the name of the original file, and then save each file
>
in the same folder. The files could have the same names as the
>
originals but with a .txt suffix.
>
>
Would greatly appreciate any help you could offer!
Bill replied:
I'm afraid I don't have time to write this script for you. However, the
script you describe is quite easy to write. It would go something like
this:
1. choose folder -- puts up a dialog where the user can choose the
folder
2. tell the Finder to repeat with every file in the folder whose kind is
jpeg (or whatever)
3. tell the Finder to get the name of the file
4. open for access a file with the same name + '.txt' in the same folder
5. set the text (contents) of the file to the name
6. close access the file
7. end repeat
Post your inquiry and this outline on Apple's applescript-users list
tonight, and you might have 2 or 3 solutions by morning.
_______________________________________________
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.