• 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
change folder name and move
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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 & "&gt;html&lt;gt;head&lt;gt;title>Move,
Images&gt;/title&lt;gt;/head&lt;gt;body bgcolor=#ffffff&lt; & moveImages() &,
"&gt;/body&lt;gt;/html&lt;
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.

  • Prev by Date: Re: Mail from AppleScript in OS X
  • Next by Date: Re: Wind Chill (corrected & full)
  • Previous by thread: Re: Mail from AppleScript in OS X
  • Next by thread: Re: Palm Desktop & Eudora
  • Index(es):
    • Date
    • Thread