applescript - delete file from root

Joined
Jun 8, 2007
Messages
43
Reaction score
0
Points
6
Code:
tell application "Finder"
   delete file "Macintosh HD:file.jpg"
end tell

I can use this code to delete a file from the root of my startup disc, which by default is called 'Macintosh HD'. But if I want to share this applescript app to other users and they happen to have a different name for 'Macintosh HD' how do I script it that it looks for the file in the root of their self renamed harddrive? No matter ware the app is placed?

Is there some code like 'delete file "_root: file.jpg" which would do that?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top