• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: duplicate command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: duplicate command (From: Robert Cuilla <email@hidden>)
 >Re: duplicate command (From: Luther Fuller <email@hidden>)
 >Re: duplicate command (From: "koenig.yvan" <email@hidden>)
 >Re: duplicate command (From: Luther Fuller <email@hidden>)
 >Re: duplicate command (From: "koenig.yvan" <email@hidden>)
 >Re: duplicate command (From: Simon Topliss <email@hidden>)
 >Re: duplicate command (From: "koenig.yvan" <email@hidden>)
 >Re: duplicate command (From: Simon Topliss <email@hidden>)
 >Re: duplicate command (From: "koenig.yvan" <email@hidden>)
 >Re: duplicate command (From: Simon Topliss <email@hidden>)
 >Re: duplicate command (From: Robert Cuilla <email@hidden>)
 >Re: duplicate command (From: Axel Luttgens <email@hidden>)
 >Re: duplicate command (From: Robert Cuilla <email@hidden>)

  • Prev by Date: Re: duplicate command
  • Next by Date: AUTO: Allyn Martin is out of office.
  • Previous by thread: Re: duplicate command
  • Next by thread: XML tags as characters in InDesign 5.5
  • Index(es):
    • Date
    • Thread