• 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
file is busy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

file is busy


  • Subject: file is busy
  • From: email@hidden
  • Date: Wed, 14 Dec 2011 17:23:26 +0100

hi,


Situation:
File are on an server volume and need to be moved and deleted.
Files that are open by a user can be moved but not deleted.
I am not able to check first if the files are open without going into detail on this.


If File are open I get the message: 
The operation can’t be completed because the item “whatever.pdf” is in use.


This should work, but for whatever reason the script never reaches the 'click button' part.


tell application "Finder"

try

move temp_file to folder FullPathDestination with replacing

delete temp_file

on error

tell application "System Events"

click button "OK" of scroll area 1 of window "Trash" of application process "Finder"

end tell

end try

end tell


Ideally would be just not to get a popup about the"file is in use" and just move on.


many thanks for any reply

/j




 _______________________________________________
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: Files Locked with Lion?
  • Next by Date: Script Editor Text Prefs Lost After System Upgrade
  • Previous by thread: Acrobat Applescript Javascript Question
  • Next by thread: Script Editor Text Prefs Lost After System Upgrade
  • Index(es):
    • Date
    • Thread