Re: Tell OS X Application...
Re: Tell OS X Application...
- Subject: Re: Tell OS X Application...
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 10 Jan 2002 10:26:57 -0800
On 1/10/02 9:23 AM, "Simon Forster" <email@hidden> wrote:
>
> Please
>
> provide the 9 lines. That's awfully short, you know, and would make it
>
> possible to see if there's any way to make it more "elegant", whereas
>
> without them we're just stumbling in the dark.
>
>
I try to avoid posting scripts 'cause they end up looking like a dogs
>
dinner but seeing as you asked:
>
>
<script snippet>
>
---------------------
>
tell application "Finder"
>
set my_file to ((desktop as string) & "vebraproperties.txt")
>
set my_app to ((name of startup disk as string) &
>
":System:Library:ScriptingAdditions:URL Access Scripting.app:")
>
end tell
>
with timeout of 300 seconds
>
using terms from application "URL Access Scripting"
>
tell application my_app to download
>
"ftp://username:password@server_ip/WEBSITE7/vebraproperties.txt" to file
>
my_file replacing yes
>
end using terms from
>
end timeout
>
---------------------
>
</script snippet>
Given that you want to be able to use the script on other machines, that
seems to me to be exactly how to do it. It seems pretty elegant to me
compared to how we used to have to do it with raw codes pre OS 9. Since
you'll be using it only in OS X (otherwise the script won't work at all)
you're safe with 'using terms from'. What you could do if you wish is:
set my_app to ((path to scripting additions folder from System domain as
string) & "URL Access Scripting.app")
which is somewhat neater.
--
Paul Berkowitz