Re: Applescript to run at shutdown...
Re: Applescript to run at shutdown...
- Subject: Re: Applescript to run at shutdown...
- From: Matthew Smith <email@hidden>
- Date: Fri, 09 Nov 2001 13:07:06 +1100
It looks like you recorded your actions. There is a lot of redundant stuff
there.
Try:
tell application "Finder"
set theFolder to duplicate folder "externaldrive:www:customer_demo:" to
desktop
Set theDate to current date
set name of theFolder to "current_demo " & date string of theDate
end tell
That should be 5 lines of code.
I assume you wanted the current date in the name. This may not work. The
name may be to long.
You also haven't taken into account the situation when the folder on the
desktop already exists. This would happen if you shut down more than once in
a day.
From memory, you shouldn't have "activate" in scripts that are to be in the
Shutdown Items folder. It stops the shutdown. Can anyone verify this?
on 09/11/01 07:51, Steve at email@hidden wrote:
>
I just created an applescript to backup a folder on a mounted server. I'd
>
like the script to be run automatically when I shut down my Mac. I tried
>
putting the script into the shutdown folder but when I shut down it would
>
open the applescript in the editor, but didn't run it.
>
>
Also I'd like to rename the folder I'm backing up with the current date.
>
>
This is the first I've messed with applescript and feel a bit lost. Thanks
>
for any help.
>
>
here' s my script:
>
tell application "Finder"
>
activate
>
select disk "externaldrive"
>
open selection
>
select folder "www" of disk "externaldrive"
>
set expanded of selection to true
>
select folder "customer_demo" of folder "www" of disk "externaldrive"
>
copy selection to desktop
>
end tell
>
tell application "Finder"
>
activate
>
select folder "customer_demo"
>
set name of selection to "customer_demo current date"
>
>
end tell
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
--
Matthew Smith
email@hidden
Tel: +61 412 088 604
+61 2 9380 6078
Fax: +61 2 9347 9140
ICQ: 20169438