Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: Mr Tea <email@hidden>
- Date: Tue, 23 Jan 2001 11:24:22 +0000
This from Shane Stanley - dateline 1/22/01 9.44 pm:
>
A single script that will interrogate the file, find out it's creator and
>
from a set of variables I have inputted in, eg if creator = ClarisWorks,
>
then add .cwk, if creator = MS Word, then add .doc, etc, etc. Add the
>
appropriate file name suffix to the file.
I use the following script to add PC extensions to a range of file types. It
should be straightforward to adapt it to your needs. (Watch out for email
induced line breaks, & if any of your file names are likely to exceed the
max number of characters allowed when the extn is added, use the 'truncate'
handler posted by Michelle Steiner.
property FileTypes : {"PICT", "JPEG", "GIFf", "BMP ", "8BPS", "MooV", "FLI
", "TEXT", "WAVE"}
property ExtnTypes : {".pct", ".jpg", ".gif", ".bmp", ".psd", ".mov",
".flc", ".txt", ".wav"}
on open
repeat with i from 1 to FileTypes's length
set theType to item i of FileTypes
set theExt to item i of ExtnTypes
tell application "Finder"
set addExt to (every item of selection whose file type is
theType)
repeat with theFile in addExt
set theFile's name to theFile's name & theExt
end repeat
end tell
end repeat
end open
This is written as a droplet, but it would be easy enough to retool it as a
folder action, if that's what you need.
Cheers
Mr Tea
--
Brew of the day: [ ibid ]