Sunday, September 21, 2003

AppleScript Whose

John Gruber writes about the AppleScript whose clause, which add a kind of declarative filtering to AppleScript. whose is great in simple situations, but it doesn’t scale. The more interesting point: why do so many languages force you to use temporary lists and loops just to filter a list? It’s sad, really.

1 Comment RSS · Twitter

i've got a vexing problem w/a whose clause, also:
eyeBundle is a local, then this code

tell application "EyeTV"
with timeout of 3 seconds
set eyeTVrec to recordings whose location contains my eyeBundle
...

fails:
EyeTV got an error: Can't get every recording whose location contains eyeBundle of «script».

but if i un the same code in a test script (not my humungous .app)

Code: Select all
set eyeBundle to "Exploring Space_ The Quest for Life - 3_7_07 8_05 PM.eyetv"
tell application "EyeTV"
with timeout of 3 seconds
set eyeTVrec to recordings whose location contains my eyeBundle

there's no problem:

tell application "EyeTV"
get every recording whose location contains "Exploring Space_ The Quest for Life - 3_7_07 8_05 PM.eyetv"
{recording id 1.95008719E+8}
get location of recording id 1.95008719E+8
file "toms160gB:Users:Shared:DVR:renamedRecs:EyeTV Archive:Exploring Space_ The Quest for Life - 3_7_07 8_05 PM.eyetv:000000000b9f98cf.eyetvr"
end tell

wtf???

Leave a Comment