• 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: Changing the name of a file in the temporary items folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing the name of a file in the temporary items folder


  • Subject: Re: Changing the name of a file in the temporary items folder
  • From: "J. Stewart" <email@hidden>
  • Date: Sun, 9 Dec 2007 12:52:53 -0500

On 12/8/07 at 10:53 AM, Skeeve <email@hidden> spake thusly:

But, as I already wrote earlier, Jon's workaround is no solution as it is impossible, using just AppleScript, to delete the temporary stuff created in a clean way.

It isn't? I find this hard to believe since I (and others) have been using Applescript to delete files/Folders for years and it's always seemed pretty clean to me. Just what is the problem you're having with the Finder's commands or the unix "rm" command?



Assuming there is a folder in the Temporary Items folder named "myotherTmpFldr" then
this gets rid of it and it's contents -


set itm2Trash to alias ((path to "temp" as Unicode text) & "myotherTmpFldr:")
tell application "Finder"
	delete itm2Trash
	empty trash
end tell

If you are getting that annoying dialog telling you that you are about to empty the trash popping up, either turn it off in the Finder's preferences or run this -

do shell script "defaults write com.apple.finder WarnOnEmptyTrash 0"

then restart the Finder to get rid of it. If you can't do that cause it's meant for another's machine? Again assuming a folder in the Temporary Items folder named "myotherTmpFldr", here's the solution for that -

set tempItemsF to quoted form of POSIX path of alias ((path to "temp" as Unicode text) & "myotherTmpFldr:")
do shell script "rm -R " & tempItemsF


--
Any government big enough to do things for you is big enough to do things to you.
_______________________________________________
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
  • Follow-Ups:
    • Re: Changing the name of a file in the temporary items folder
      • From: Skeeve <email@hidden>
References: 
 >Re: Changing the name of a file in the temporary items folder (From: Skeeve <email@hidden>)

  • Prev by Date: Batch Printing Microsoft word to PDF
  • Next by Date: Choose Folder Location
  • Previous by thread: Re: Changing the name of a file in the temporary items folder
  • Next by thread: Re: Changing the name of a file in the temporary items folder
  • Index(es):
    • Date
    • Thread