change folder name and move
change folder name and move
- Subject: change folder name and move
- From: Michael Britt <email@hidden>
- Date: Fri, 01 Mar 2002 12:57:15 -0800
I am building a cgi that will take a folder called images, change the name
to images + a sequential number and move it into an image archive folder.
If I set the path to the images folder as an alias the script works fine,
once. I need it to work every time a new images folder is loaded into the
update folder. If I use the path without an alias, the name changes and
then the move script can't find the images folder. See full script below.
I have been setting this up so that I can load the images folder and the
database update then trigger the script via a URL. Would a watched folder
process work better? If so, how would I go about setting it up?
property folderNumber : 37
set folderNumber to folderNumber + 1
on handle CGI request
set crlf to (ASCII character 13) & (ASCII character 10)
set metaHtml to "HTTP/1.1 200 OK" & crlf & "Content-type: text/html" &
crlf & crlf
set replyHtml to metaHtml & ">html<gt;head<gt;title>Move,
Images>/title<gt;/head<gt;body bgcolor=#ffffff< & moveImages() &,
">/body<gt;/html<
return replyHtml
end handle CGI request
on moveImages()
tell application "Finder"
set updateImages to alias,
"Alternistock:WebSTAR:pub:SPS:doneill:database:update:images:" (*this is the
folder where I upload new images*)
set name of updateImages to "images" & text -4 thru -1 of ,
("000" & folderNumber)
set imageDestFolder to alias,
"Alternistock:WebSTAR:pub:SPS:doneill:images:"
set newLoc to folder imageDestFolder
set newPath to newLoc as text
move updateImages to newLoc
return "Your Images have been moved to: " & newPath
end tell
end moveImages()
--
Michael Britt
email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.