Re: Change type/creator
Re: Change type/creator
- Subject: Re: Change type/creator
- From: Bernard Azancot <email@hidden>
- Date: Wed, 22 Sep 2004 11:34:02 +0200
I wrote:
I have written a bunch of little simple applets each one changing the
type/creator of documents to others (TextEdit -> Tex Edit pro...).
I would like to know how to write an applet which first reads
type/creator from a first dropped document file and change a second
dropped file's one.
Thanks in advance.
I answer (to myself):
Young newbie, try this:
--
property chgCreator : ""
property chgType : ""
property toChange : false
on open currList
tell application "Finder"
set currListCount to count of items in currList
set currItem to 0
if toChange is true then
repeat currListCount times
set currItem to currItem + 1
set creator type of item currItem of currList to chgCreator
set file type of item currItem of currList to chgType
end repeat
set toChange to false
else
set chgCreator to creator type of item 1 of currList
set chgType to file type of item 1 of currList
set toChange to true
end if
end tell
end open
on run
display dialog "You must drop a file on the droplet to change files.
You cannot double-click the applet." giving up after 10
end run
--
This list is a marvell. Such a reactivity !
Thanks again, Bernard.
Regards
Bernard
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden