Re: Processing files in nested folders
Re: Processing files in nested folders
- Subject: Re: Processing files in nested folders
- From: "Martin Dahl" <email@hidden>
- Date: Tue, 20 Jan 2004 13:42:59 +0100
Hi..
OS 9.2.2, AppelScript 1-1.7
I'm quite sure it freezes beacuse if i try to get info for folder instead of
a file it works.
Below is my current source code:
property targetPath: "HD:theFolder:"
property targetFolder: 0
on run
set targetFolder to alias targetPath
end run
on idle
folderChanged(targetFolder)
return 60
end idle
on folderChanged(f)
set these_items to list folder f without invisibles
repeat with i in these_items
set this_item to alias ((f as text) & i)
set the item_info to info for this_item
if (folder of item_info is true) then
beep
end if
end repeat
end folderChanged
This simple script will just scan a folder and beep one time for each
subfolder found. If the targatFolder only contains folders it works. If I
put a text file in the folder it doesn't work.
Really strange, been stuck with this a day now :-(
/Martin
-----Ursprungligt meddelande-----
Fran: email@hidden
[
mailto:email@hidden]For Axel Luttgens
Skickat: den 20 januari 2004 13:18
Till: AppleScript Users
Amne: Re: Processing files in nested folders
Martin Dahl wrote:
>
[...]
>
set theItem to alias "HD:Folder:MyFile.txt"
>
set theInfo to info for theItem
>
>
The computer freeze's every time. Why?
>
>
>
Damn. What are your OS and AppleScript versions?
Anyway, are you sure it is a freeze?
For example, applied to a disk or folder, "info for" may last for a very
long time, as it has to calculate the item's size.
And are you sure the freeze occurs at "info for"?
Could you provide us with the minimal and unchanged code snippet
provoking the symptom on your computer?
Axel
_______________________________________________
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.
_______________________________________________
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.