Re: Scripting Additions: Embracing the Horror of Unix
Re: Scripting Additions: Embracing the Horror of Unix
- Subject: Re: Scripting Additions: Embracing the Horror of Unix
- From: Jon Pugh <email@hidden>
- Date: Fri, 1 Feb 2002 17:09:15 -0800
At 8:16 AM +1100 2/2/02, Shane Stanley wrote:
>
(The fact that, in all this discussion, no-one has come up with a complete,
>
robust, ready-to-be-copied-and-pasted handler for any of the missing Jon's
>
commands suggests it's either not particularly straight forward, or so
>
simple I'm missing the bleeding obvious.)
I consider it mildly obvious, given the sticks we've been beating this horse with.
on qf(f)
return quoted path of posix path of f
end
on deleteFile(f)
do shell script "rm " & qf(f)
end
on copyFile(s, d)
do shell script "cpMac " & qf(s) & " " & qf(d)
end
on moveFile(s, d)
do shell script "mv " & qf(s) & " " & qf(d)
end
These may or may not be robust, as they haven't been tested. I just wrote them off the top of my head in a vain effort to get Shane to mellow out. ;)
There may be options one would want to add. I haven't got the time to work out which ones are appropriate.
I think my largest point here is that in Mac OS 9, the simplest way to add functionality to AppleScript was to write a scripting addition instead of an application. Now, in Mac OS X, applications are theoretically easier to write, and scripting additions can generally be replaced by calls to the shell, since they are generally doing simple things that can't be done in straight AppleScript. That means the incentive to write a new scripting addition in OS X is fairly low, as a built-in workaround is pretty easy, considering.
Jon