Re: Folder action question
Re: Folder action question
- Subject: Re: Folder action question
- From: Mátyás Ferenc Farkas <email@hidden>
- Date: Sun, 25 Jan 2004 17:57:58 +0100
hi
i am a little bit confused. where is the character limit check? the
folder action calls the on adding folder items to this_folder after
receiving added_items only, when the window of the folder is open or
using a column view (command + 3). so you want to rename the pdf
dragged at the folder to the name of the folder and the name of the
dragged item. at this handler the quest is the added_items variable,
which stores the alias list of the dragged elements. the scripts does
not utilize the folder action mechanism, only the regular methods.
BUT, i have a strange error with folder actions. i write the following
code, which does the same:
on adding folder items to this_folder after receiving added_items
tell application "Finder"
repeat with i from 1 to (count every item in added_items)
if file type of item i of added_items is "PDF " then
set name of item i of added_items to name of this_folder & name of
item i of added_items
end if
end repeat
end tell
end adding folder items to
but the on adding folder items to this_folder after receiving
added_items gets called for eternity. i added some debugging
information:
on adding folder items to this_folder after receiving added_items
try
tell application "Finder"
display dialog (count every item in added_items) as string
display dialog (added_items) as string
repeat with i from 1 to (count every item in added_items)
if file type of item i of added_items is "PDF " then
set name of item i of added_items to name of this_folder & name of
item i of added_items
end if
end repeat
end tell
on error -- errmsg number errNum from errFrom partial result errResult
to errTo
beep 5 --errorReporter(errmsg, errNum, errFrom, errResult, errTo) of
me
end try
end adding folder items to
on errorReporter(errmsg, errNum, errFrom, errResult, errTo)
tell application "Finder"
set furl to ((path to desktop folder) as string) & ":errorlog.txt" as
string as +class furl;
set openfile to open for access furl with write permission
try
set eof of openfile to (get eof openfile)
set thedata to return & return & "---------------------------------"
& return & errmsg & return & errNum & return & errFrom & return &
errResult & return & errTo & return & (current date) & return
say "Error!"
write thedata starting at (get eof of openfile) to openfile
open furl
close access openfile
on error
close access openfile
end try
end tell
end errorReporter
it does not give me an error, when i cancel click the display dialog,
the beep 5 works only, my errorReporter handler does not gets called.
at the first call, the number of the added items is correct, 3 for
example, and after that at the unneded executions it shows me 2 every
time. now what. ideas? the simplest script at the top level works for
somebody?
--
matyas
_______________________________________________
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.