Re: duplicate command
Re: duplicate command
- Subject: Re: duplicate command
- From: "koenig.yvan" <email@hidden>
- Date: Sun, 14 Apr 2013 23:19:48 +0200
Le 14/04/2013 à 22:54, Robert Cuilla < email@hidden> a écrit : Axel
below is a snippet of a larger AS which works just fine.
Here is the deal..
I have a USB external drive named "Time Machine" and in this snippet want to move the file "insurance claims,fmp12" to the trash.
works great after the Finder requests the admin password and I enter it.
I only want to somehow embed the password into my script so I dont have to always put it in manually
****************************
tell application "Finder" if exists "Time Machine:" then
if exists "Time Machine:insurance claims.fmp12" then move "Time Machine:insurance claims.fmp12:" to trash
end if end if end tell
****************************
Thanks
Bob
I always do my best to never trigger the Finder in scripts so my proposal is :
set deleteIt to false tell application "System Events" if exists disk item "Time Machine:" then if exists disk item "Time Machine:insurance claims.fmp12" then set deleteIt to true end if end tell if deleteIt then do shell script "rm " & quoted form of POSIX path of "Time Machine:insurance claims.fmp12:" password "azertyuiop" with administrator privileges end if
Of course you must edit the fake password to fit your setting.
Yvan KOENIG (VALLAURIS, France) dimanche 14 avril 2013 23:17:46
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden