Re: AppleScript Studio & File Paths
Re: AppleScript Studio & File Paths
- Subject: Re: AppleScript Studio & File Paths
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 12 May 2008 22:58:41 -0400
On Mon, May 12, 2008 at 10:55 PM, Mark J. Reed <email@hidden> wrote:
> set myFile to choose file
> set newName to "." & name of (get info for myFile)
> tell application "System Events" to set name of myFile to newName
Or just do it all with System Events, no need for get info:
set myFile to choose file
tell application "System Events" to set name of myFile to "." & name of myFile
of course you can always be more verbose if you want...
set myFile to choose file with prompt "Pick a file to hide."
tell application "System Events"
set oldName to name of myFile
set newName to "." & oldName
display dialog "Renaming '" & oldName & "' to '" & newName & "'"
set name of myFile to newName
end tell
--
Mark J. Reed <email@hidden>
_______________________________________________
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