Re: Type/Creator again...
Re: Type/Creator again...
- Subject: Re: Type/Creator again...
- From: Sander Tekelenburg <email@hidden>
- Date: Mon, 6 May 2002 17:31:51 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
At 10:53 -0400 UTC, on 06-05-2002, Hellum Timothy wrote:
>
Hi all,
>
>
I don't do very much AppleScript, but why won't this folder action work
>
on a file dropped or saved into the "watched" folder?
Your variable theList is undefined.
>
property fileType : "JPEG"
>
property creatorType : "8BIM"
>
--
>
on adding folder items to this_folder after receiving added_items
>
tell application "Finder"
>
repeat with theItem in theList
Change that line to:
repeat with theItem in added_items
and it should work.
You've already defined added_items as the variable that contains the list of
items (the items dropped on the folder). So *that* is the list you want to
use in your repeat loop.
Debugging things like folder action scripts is hard, 'cause you can't run
them in Script Editor to see what is happening. There are better script
editors available. For instance Script Debugger [SD], which may make these
kinds of things easier. (SD lets you step through scripts line by line, and
even step through idle handlers. Perhaps it can do that sort of thing with
folder actions as well.)
Alternatively, or in addition, you can build your own little debugger. Wrap
parts of your script in try blocks, catch the error, and have it delivered to
you. Something like this:
try
sing -- the line(s) you're testing
on error m number n
beep
activate
display dialog (n as text) & return & return & (m as text)
end try
It may also be that you are very new to all this scripting stuff and that
you simply haven't grasped the concept of variables yet. I know it took me
quite a while before I did :) Something like "theItem", and even more just
"i", looked just another magic command... Those were happy days... :)
HTH
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <
http://www.pgp.com>
iQA/AwUBPNah3usywKfXgqKdEQJQzgCgr9sQT80erMxjDiz5ML3N6zdB/w8An2r4
RkjGOhY0h5AS9/wYkIUN61dp
=24hi
-----END PGP SIGNATURE-----
--
Sander Tekelenburg, <
http://www.euronet.nl/~tekelenb/>
_______________________________________________
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.