set pathToMe to (choose file with prompt "Display path of:") display dialog GetParentPath(pathToMe) on GetParentPath(theFile) tell application "Finder" to return container of theFile as text end GetParentPath tell application "Finder" set theFldr to folder "files" of folder "temp" of disk "Macintosh HD" move (every file of theFldr whose name contains "test" and name contains ".htm") to trash end tell --------------------------- -- backup.scpt -- Copyright 2006 Matthew Taylor -- A script to logon to a server and copy a local directory to the server. -- Constant Definitions -- the name of the server to back up to property Server : "olympus" -- the name of the volume on the server to back up to property Volume : "Backup" -- login name for the backup server property Loginname : "admin" -- login password for the backup server property LoginPassword : "plann1n9" -- the user we are backing up property UserName : "Office Administrator" -- error handling set noError to true tell application "Finder" try mount volume Volume on server Server as user name Loginname with password LoginPassword on error set noError to false end try if (noError) then -- Backup Destination set the destination to folder UserName of folder "Administration" of disk Volume -- Backup Documents -- -- -- Backup Source set the source to folder "Documents" of startup disk -- Perform Backup --with timeout of 900 seconds -- duplicate source to destination with replacing --end timeout -- Backup Desktop Folder -- -- -- Backup Source display dialog desktop as text get (path to desktop folder) set dtf to result set the source to desktop as alias -- Perform Backup with timeout of 900 seconds duplicate source to destination with replacing end timeout -- Disconnect from the server eject Volume end if end tell if not noError then display dialog "For some reason the backup has failed! Please contact Matt Taylor." buttons {"OK"} default button 1 end if