• 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
Re: Folder Action to create Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder Action to create Archive


  • Subject: Re: Folder Action to create Archive
  • From: kai <email@hidden>
  • Date: Mon, 14 Mar 2005 01:20:35 +0000


On Sunday, March 13, 2005, at 08:50 pm, Todd Geist wrote:

Well still no luck!

I tried this script.  It compiles correctly but still does not produce results.

property z : "Archived"

set s to alias "user:Desktop:test:"
set l to {alias "user:Desktop:test:zoning.doc"}

tell application "Finder" to tell folder s to if exists folder z then
   set f to folder z as alias
else
   set f to (make new folder at it with properties {name:z}) as alias
end if
if l is not {f} then tell application "DropZip" to zip l into f with individually


The first time it runs I get this error.

        Can't make folder "Archived" of folder "test" of folder "Desktop" of item "user" into a alias.

The second time I get this error,

       Finder got an error: The operation could not be completed because there is already an item with that name.

because the “Archived” Folder is already there.  Shouldn’t the script be handling that?

I am clueless.

Sometimes I think most of us are fumbling around in the dark, Todd. But surely that's half the fun... ;-)


You're right, of course - the script should be handling the stuff that's causing the problems you mention. Indeed, it does just that on my machine. I ran the above, changing only the paths for the variables 's' & 'l', and it ran faultlessly. How frustrating is that? (I'm assuming that your paths are valid, since they were compiled as aliases.)

Off the top of my head, I can only assume that my syntax might be pushing its luck on your system. I can't really think why that should be - I don't think there's anything too unconventional in there. All the same, I've played it a bit safer below, in a bid to encourage more co-operation.

I'm obviously second-guessing things remotely, so don't get your hopes up too high yet - but try this anyway:

------------

property z : "Archived"

set s to "user:Desktop:test:" as alias (* test only *)
set l to {((s as Unicode text) & "zoning.doc") as alias} (* test only *)

-- on adding folder items to s after receiving l

tell application "Finder"
set f to folder z of folder s
if (exists f) then
set f to f as alias
else
set f to (make new folder at folder s with properties {name:z}) as alias
end if
end tell
if l is not {f} then tell application "DropZip" to zip l into f with individually


-- end adding folder items to

------------

---
kai

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Folder Action to create Archive (From: Todd Geist <email@hidden>)

  • Prev by Date: File Vault Issue
  • Next by Date: Re: Folder Action to create Archive [Solved]
  • Previous by thread: Re: Folder Action to create Archive [Solved]
  • Next by thread: lists and items and position of items
  • Index(es):
    • Date
    • Thread