i have a script that contains a couple lines that grabs all items modified after a certain date. if i apply the script on a local folder it works fine, like so:
set yesterday to (current date) - (60 * 60 * 24)
set finder to application "Finder"
set import_folder to "toimport:"
-- a folder on my desktop
set folder_reference to a reference to finder's item import_folder
set import_songs to items of folder_reference whose modification date is greater than yesterday
however, if i try to run this same script on a samba share that i have mounted on my desktop, it croaks with “could not convert some items to expected type”
i can do:
set import_songs to items of folder_reference whose name contains ".mp3"
and that works fine with the samba share. i can also just grab all of the items and check their item info individually for the date modified, and that also works. unfortunately, i have about 6000 items in this share at any given time, so grabbing each individual item’s item info is REALLY slow.
any idea why i can’t grab these items by “modification date”?
set theFolder to choose folder with prompt "Please select the folder to process" as string --Can be coded to a specific folder if you want
set yesterday to (current date) - (60 * 60 * 24)
tell application "Finder"
set import_songs to every item of folder theFolder whose modification date ≥ yesterday
end tell
Model: Dual 2.3 GHz G5
AppleScript: 1.10
Browser: Firefox 1.0.4
Operating System: Mac OS X (10.4)
Thanks for your input Shai1. Unfortunately, something like this,
where “scratch:” is the samba share:
set folder_reference to "scratch:"
tell application "Finder"
set import_songs to every item of folder folder_reference whose modification date is less than (current date)
end tell
still returns the error “can’t make some data into the expected type” …
however, filtering by name, eg, works fine:
set folder_reference to "scratch:"
tell application "Finder"
set import_songs to every item of folder folder_reference whose name contains ".mp3"
end tell
I’m pretty stumped. I either want to get this to work, or find some other way to get a list of item references for items that have been modified since a given date.
One additional point: I tested this script on another samba share, this time on a Windows machine (the one at home is on a Debian box) and it doesn’t work there either, so I know it’s not an issue with the OS or config of samba.