• 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
Emptying the "Volumes" folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emptying the "Volumes" folder


  • Subject: Emptying the "Volumes" folder
  • From: "Mr. T." <email@hidden>
  • Date: Wed, 16 Apr 2008 13:12:21 -0400

Greetings!

Note:  I am a total "newbie" at applescripts so please excuse me if my question is a bit "elementary".

Problem:

At the schools where I work we utilize a software program  which requires the use of a common share point where marks are stored for our students.  The share is mounted for users with a custom AFP mount script, which was created to mount the share using the share's owner and provide read/write access.  Our issue revolves around the client machines "caching" the share point in the Volumes folder on some of the clients.  We haven't been able to troubleshoot the root cause of why this happens, but think it may be users shutting down the machine without ejecting the volume.

With that in mind we created a "clean up script" which ejects the volume for the users but still find some "caching" of the share point. So as new students attempt to use the program there are "duplicates" of the share which look like the following:

"BasicSkills-1"
"BasicSkills-2" and so on.  What I did was create an applescript, which opens and deletes the duplicates in the volumes folder on each machine and deletes the duplicates for the users on log in.  I wrote the simple script, which works fine, until it moves the folders to the trash (asks for admin name and password).  Since the volumes folder is only allowed to be modified by an admin user... I'd like the script to supply it.  I've tried several times to create the proper language in the script but have failed miserably.

Can anyone offer some assistance?  I've included the script below for a review.

Thanks in advance for any advice....

Regards,

Joe

Script below:

tell application "Finder"
activate
make new Finder window
set target of Finder window 1 to item "Volumes" of startup disk
end tell
tell application "Finder"


if exists item "BasicSkillsData" of item "Volumes" of startup disk then delete item "BasicSkillsData" of item "Volumes" of startup disk
if exists item "BasicSkillsData-1" of item "Volumes" of startup disk then delete item "BasicSkillsData-1" of item "Volumes" of startup disk
if exists item "BasicSkillsData-2" of item "Volumes" of startup disk then delete item "BasicSkillsData-2" of item "Volumes" of startup disk
if exists item "BasicSkillsData-3" of item "Volumes" of startup disk then delete item "BasicSkillsData-3" of item "Volumes" of startup disk


close every window
end tell

 _______________________________________________
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

  • Prev by Date: Re: OT: Airport on Leopard
  • Next by Date: Getting elements of a list
  • Previous by thread: Re: Implementing a Map class in AS
  • Next by thread: Getting elements of a list
  • Index(es):
    • Date
    • Thread