Hi, I have an image control that I load from a file on disk. I would like to change the name of the image, and have it change the name of the file on disk. Is there an easy way to do this?
Thanks,
--Doug
changing file name
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: changing file name
Hi Doug,
you can:
To rename an image inside of your stack.
Use the "rename" command to rename the image (or any file) on disk:
Best
Klaus
you can:
Code: Select all
...
set the name of img "Old name of your image" to "New name of your image"
...
Use the "rename" command to rename the image (or any file) on disk:
Code: Select all
...
rename file "/Users/klaus/Desktop/jigsawtest.jpg" to "/Users/klaus/Desktop/a completetely new name.jpg"
...
Klaus
Re: changing file name
Thanks Klaus,
Works great. My rename code now looks like:
Just thought I'd post this in case anyone else wants a snippet to do a similar thing.
Thanks again,
--Doug
Works great. My rename code now looks like:
Code: Select all
on mouseUp
put the fileName of image "image" into tOldName
set itemDelimiter to "."
put tOldName into tNewName
ask "New Name:"
put it into item 1 of tNewName
rename file tOldName to (defaultFolder & "\" & tNewName)
send "openstack" to stack "ImageBrowser" ##refresh list of file names
end mouseUp
Thanks again,
--Doug