Re: OS 10.4.5 breaks script, "startup disk missing value"
Re: OS 10.4.5 breaks script, "startup disk missing value"
- Subject: Re: OS 10.4.5 breaks script, "startup disk missing value"
- From: James Weisbin <email@hidden>
- Date: Wed, 15 Feb 2006 15:40:38 -0500
I don't know why it wasn't working before. I rebooted and it worked
again - somehow it lost the name of the startup disk, but found it
again after a restart.
Your version is much better than mine! I left out an important bit to
shorten the posting - it's the Quicktime part. Here is the full, new
working version. I know I shouldn't nest the Quicktime tell block in
a finder tell block, but I can't figure out a way around that. The
number 30 is just an arbitrary number to prevent users from scanning
every audio file on their drive - could be thousands.
tell application "Finder"
activate
set name_text to ""
set found_items to 0
set this_folder to choose folder with prompt ¬
"Choose a folder to list:"
try
set folder_items to every file of this_folder whose ¬
(file type is "AIFF" or ¬
file type is "MPG3 " or ¬
file type is "WAVE")
set found_items to count of folder_items
on error error_message number error_number
end try
if found_items > 0 then -- don't bother if list is empty
if found_items > 30 then
set folder_items to items 1 through 30 of folder_items
set found_items to 30 -- no need to recount, we know it's 30
end if
repeat with mycount from 1 to found_items
set this_one to ((item mycount of folder_items) as alias)
tell application "QuickTime Player"
open this_one
set the time_scale to the time scale of movie 1
set the movie_duration to the duration of movie 1
set the movie_length to ((((movie_duration / time_scale) div 60)
* 10 div 10) as string) & ":" & (((((movie_duration / time_scale /
60) - ((movie_duration / time_scale) div 60)) * 60) * 10 div 10) as
string)
close movie 1
end tell
set name_text to (name_text & mycount & tab & ¬
(name of item mycount of folder_items) as string) & tab &
movie_length & ¬
tab & return
end repeat
set the clipboard to «class ktxt» of ((the name_text as text) ¬
as record)
else
set the clipboard to ""
end if
end tell
Thanks!
You wrote:
tell application "Finder"
activate
set name_text to ""
set found_items to 0
set this_folder to choose folder with prompt ¬
"Choose a folder to list:"
try
set folder_items to every file of this_folder whose ¬
(file type is "AIFF" or ¬
file type is "MPG3 " or ¬
file type is "WAVE")
set found_items to count of folder_items
on error error_message number error_number
end try
if found_items > 0 then -- don't bother if list is empty
if found_items > 30 then
set folder_items to items 1 through 30 of folder_items
set found_items to 30 -- no need to recount, we know
it's 30
end if
repeat with mycount from 1 to found_items
set name_text to (name_text & mycount & tab & ¬
(name of item mycount of folder_items) as string) & ¬
tab & return
end repeat
set the clipboard to «class ktxt» of ((the name_text as
text) ¬
as record)
else
set the clipboard to ""
end if
end tell
Jim Weisbin
human
138 5th avenue. 3rd floor, nyc, ny 10011
telephone 212 352 0211
facsimile 212 352 0210
<email@hidden>
http://www.humanworldwide.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden