Re: Change type/creator
Re: Change type/creator
- Subject: Re: Change type/creator
- From: Michelle Steiner <email@hidden>
- Date: Wed, 22 Sep 2004 02:33:19 -0700
On Sep 21, 2004, at 11:30 PM, Bernard Azancot wrote:
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.
The problem is that when you drop more than one file, you have no
control over the order they appear in the list, so the script doesn't
know which is supposed to be the first and which is supposed to be the
second.
One solution that I can see is this, but only if there are only two
files involved. Save the following script as an application, with
"stay open" checked. Keep in mind that many OS X applications do not
have file or creator types.
property first_doc : true
property file_creator : missing value
on run
tell application "Script Editor"
open (path to me)
end tell
end run
on open {dropped}
if first_doc is true then
tell application "Finder"
set file_creator to the creator type of dropped
end tell
set first_doc to false
else
tell application "Finder"
set the creator type of dropped to file_creator
end tell
set first_doc to true
set file_creator to missing value
tell me to quit
end if
end open
--
"Condoms encourage promiscuity
- in the same way that seat belts encourage automobile accidents."
O.C. Brown
_______________________________________________
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