- Registriert
- 18.12.06
- Beiträge
- 1.407
Hallo! Ich möchte wegen meines Problems keinen neuen Thread eröffnen.. AgentSmith, aAngeregt durch deinen wiedermal sehr nützlichen Thread, möchte ich mir gerade ein Droplet erstellen, welches Quicktime Player benutzt, um movielinks der gedroppten Filme zu erstellen. Im Netz habe ich eine Anweisung für ein Script dafür gefunden. Jedoch habe ich damit Schwierigkeiten - vielleicht kann mir hier jemand helfen! Hier das Script:
Ich möchte 1. das Script ausschließlich als Droplet benutzen, daher bräuchte ich den ersten Teil ja schonmal nicht, richtig? Dann soll das Script 2. immer als Output den gleichen Ordner nehmen, aus dem die gedroppten items kommen und 3. einen festdefinierten Settings-file benutzen.
Das Script soll mich also nicht dauernd fragen, wo was liegt. Wie mache ich das?
Außerdem habe ich Probleme mit den Quicktime-Settings. Ich habe folgendes gemacht, um die Settings zu sichern:
Jedoch exportiert Quicktime den Film nicht in das gewünschte Format. Was mache ich falsch? Sollte das hier zu sehr OT sein, bitte sagen, dann mach' ich einen eigenen Faden dafür.[/QUOTE]
Code:
-- Try to save some default folders, so you don't jump back and forth for videos and settings file.
property chooseFileFolder : "~/Movies"
property settingsFolder : "~/save_as_movielink"
on run
checkAlias(chooseFileFolder)
choose file with prompt "Select the file(s) to export:" default location result with multiple selections allowed without invisibles
set chosenFiles to result
set chooseFileFolder to parentFolder(first item of chosenFiles)
open chosenFiles
end run
on open theseItems
choose folder with prompt "Choose destination for exported file(s):"
set exportFolder to result as Unicode text
checkAlias(settingsFolder)
choose file with prompt "Choose the QuickTime export settings file:" default location result
set exportSettingsFile to result
set settingsFolder to parentFolder(exportSettingsFile)
try
tell application "QuickTime Player"
activate
close every window
end tell
end try
repeat with thisItem in theseItems
-- Use the original name for the exported file
set {name:thisName, folder:isFolder} to (info for thisItem without size)
-- Skip any folders that were dropped
if not (isFolder) then
-- Remove extension from original name, if any
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"."}
try
set thisName to text 1 thru text item -2 of thisName
end try
set AppleScript's text item delimiters to ASTID
tell application "QuickTime Player"
try
open thisItem
if (can export front document as QuickTime movie) then
-- If the AppleScript takes too long (more than a minute) on a certain command, it will throw a timeout error.
-- Use a `timeout` block when something might take longer to finish.
with timeout of 86400 seconds -- 24 hours
export front document to (exportFolder & thisName) as QuickTime movie using settings exportSettingsFile
end timeout
else
display dialog "QuickTime Player can't export “" & thisName & "” as a QuickTime movie." buttons {"Skip File"} default button 1 with icon caution
end if
on error errMsg number errNum
if errNum is -2019 then set errMsg to "The export was canceled in QuickTime Player."
display dialog "Error " & errNum & return & return & errMsg buttons {"Cancel Script", "Skip File"} default button 2
if (button returned of result) is "Cancel Script" then error number -128
end try
try
close front document saving no
end try
end tell
end if
end repeat
quit application "QuickTime Player"
tell me to display dialog "Export script finished!" buttons {"View Export Folder", "OK"} default button 2 with icon note
if (button returned of result) is "View Export Folder" then tell application "Finder" to open exportFolder
end open
on checkAlias(someItem)
try
return someItem as alias
on error
return path to home folder
end try
end checkAlias
on parentFolder(someItem)
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to {":"}
try
set someFolder to (text 1 thru text item -2 of (someItem as Unicode text)) & ":"
on error
set someFolder to ""
end try
set AppleScript's text item delimiters to ASTID
return someFolder
end parentFolder
Ich möchte 1. das Script ausschließlich als Droplet benutzen, daher bräuchte ich den ersten Teil ja schonmal nicht, richtig? Dann soll das Script 2. immer als Output den gleichen Ordner nehmen, aus dem die gedroppten items kommen und 3. einen festdefinierten Settings-file benutzen.
Das Script soll mich also nicht dauernd fragen, wo was liegt. Wie mache ich das?
Außerdem habe ich Probleme mit den Quicktime-Settings. Ich habe folgendes gemacht, um die Settings zu sichern:
Code:
tell app "QuickTime Player"
tell first movie
save export settings for QuickTime movie to file "~/Export to Xyz Format"
end tell
end tell
Jedoch exportiert Quicktime den Film nicht in das gewünschte Format. Was mache ich falsch? Sollte das hier zu sehr OT sein, bitte sagen, dann mach' ich einen eigenen Faden dafür.[/QUOTE]