Re: Quicktime question
Re: Quicktime question
- Subject: Re: Quicktime question
- From: KOENIG Yvan <email@hidden>
- Date: Sun, 13 Apr 2008 18:52:38 +0200
Le 13 avr. 2008 à 17:30, David A a écrit :
Hi All,
i'm new to applescript, and am trying to create a script for a web
application that will:
1) convert all files that get uploaded to a directory to hinted,
self-contained qt movies (using qt pro)
2) deposit the converted files to a different directory.
here's what i've got so far:
on adding folder items to this_folder after receiving these_items
tell application "Finder"
if not (exists folder "Done" of this_folder) then
make new folder at this_folder with properties
{name:"Done"}
end if
set the destination_folder to folder "Done" of this_folder
as alias
end tell
repeat with i from 1 to number of items in these_items
set this_item to item i of these_items
set the item_info to info for this_item
set file_name to the name of the item_info
if the name extension of item_info is in {"mp3", "wav"} then
tell application "QuickTime Player"
launch
display dialog destination_folder & file_name
export item_info to (destination_folder &
file_name) as "QuickTime hinted movie"
end tell
end if
end repeat
end adding folder items to
This executes correctly when something is dropped in the folder,
but does not handle the conversion.
Are you sure that you must export item_info …
My guess is that it would be better to
export this_item …
It seems that there is an other anomaly.
set the destination_folder to folder "Done" of this_folder as alias
defines the variable destination_folder as an alias
but some instructions down you write:
export item_info to (destination_folder & file_name) as "QuickTime
hinted movie"
You are not allowed to concatenate an alias to a string.
edit like that:
set destination_folder to folder "Done" of this_folder as Unicode
text
For my own use, I would code:
repeat with this_item in these_items
set item_info to info for this_item
set file_name to name of item_info
if name extension of item_info is in {"mp3", "wav"} then
tell application "QuickTime Player"
launch
display dialog destination_folder & file_name
export this_item to (destination_folder & file_name)
as "QuickTime hinted movie"
end tell
end if
end repeat
Yvan KOENIG (from FRANCE dimanche 13 avril 2008 18:42:44)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden