AS treibt mich zur Weißglut

detto

Aktives Mitglied
Thread Starter
Dabei seit
22.08.2007
Beiträge
3.182
Reaktionspunkte
263
So langsam bin ich echt bedient :rolleyes:
Da denkt man die ganze Zeit es wird langsam mit AS dann ploppen einem Sytanxfehler entgegen die einem nicht in Kopp wollen:

Code:
on run()
	set the_selection to choose file with prompt "Pick your desired file(s):" ¬
		default location path to home folder ¬
		without invisibles ¬
		without multiple selections allowed ¬
		without showing package contents
	repeat with cur_file in the_selection
		set parentDir to container of cur_file
		tell app "QuickTime Player"
			save reference movie to parentDir
		end tell
	end repeat
end run

Sobald ich das Skript kompilieren lassen möchte kommt folgende Meldung


:confused: :mad: :eek:
 
Hallo,

das ist eine Aufzählung an Attributen.

Code:
	set the_selection to choose file with prompt ¬
		"Pick your desired file(s):" default location (path to home folder) ¬
		without showing package contents, multiple selections allowed and invisibles

Viele Grüße
 
  • Gefällt mir
Reaktionen: detto
Das verwundert mich stark. Ist TextMate in der Beziehung veraltet was AppleScript angeht? Ich hab das Skript nämlich mit TM erstellt, und dort wird mir folgende Funktion per Snippet erstellt:
Code:
set the_file to choose file with prompt "Pick a file:" ¬
	default location path to home folder ¬
	with invisibles ¬
	with multiple selections allowed ¬
	with showing package contents
 
Ich rall es nicht, so funktioniert das kompilieren:

without showing package contents, multiple selections allowed and invisibles


Änder ich die Zeile folgendermaßen um:

with multiple selections allowed, without showing package contents and invisibles
oder
multiple selections allowed, without showing package contents and invisibles
oder, oder, oder...

Es kommen NUR Meldungen wie: Ausruck erwartet aber Parametername gefunden, Ausdruck erwartet aber ein "," gefunden, Es wurde „„into“, Variablenname, Klassenname, anderer Parametername oder Eigenschaft“ erwartet, aber ein „„without““ wurde gefunden.

*totalgarnichtsmehrkapierundinsbettgeh*
 
Hmm... ich habs nu erst amal so gelöst :rolleyes:

Code:
tell application "QuickTime Player"
	activate
end tell

repeat 1 times
	tell application "System Events"
		tell application process "QuickTime Player"
			keystroke "s" using {command down, shift down}
			tell window 1
				tell sheet 1
					tell group 1
						tell radio group 1
							click radio button "Als Referenzfilm sichern"
						end tell
					end tell
					click button "Sichern"
				end tell
			end tell
		end tell
	end tell
	
	tell application "System Events"
		tell application process "QuickTime Player"
			keystroke "w" using command down
		end tell
	end tell
end repeat

Komm damit iwie besser klar.
Danke den Helfenden. :> :cake:
 
  • Gefällt mir
Reaktionen: usls1
hab mich jetzt auch seit 2 tagen mit AS herumgeschlagen.
und jetzt bin ich endlich fertig
hier mein entwurf, sicher mit einigen schönheitsfehlern und etwas verwirrend programmiert, aber vll hilft es ja jemanden

Code:
global alias_folder
global chosen_files

on run
	set alias_folder to (choose folder with prompt "Bitte Zielordner wählen" without invisible)
	set chosen_files to (choose folder with prompt "Bitte Ordner mit den Filmen wählen:" with multiple selections allowed without invisible)
	
	tell application "QuickTime Player"
		activate
		close every window
	end tell
	
	repeat with FolderLayer1 in chosen_files
		if (folder of (info for FolderLayer1 without size)) is true then
			repeat with FolderLayer2 in (list folder FolderLayer1 without invisibles)
				set searchFolder to (FolderLayer1 & FolderLayer2) as text
				if (folder of (info for alias searchFolder without size)) is true then
					repeat with FolderLayer3 in (list folder alias searchFolder without invisibles)
						prozess(FolderLayer1, FolderLayer2 & ":", FolderLayer3)
					end repeat
				else
					prozess(FolderLayer1, "", FolderLayer2)
				end if
			end repeat
		end if
	end repeat
	quit application "QuickTime Player"
end run

on prozess(main_folder, sub_folder, get_name)
	set main_folder to (main_folder & sub_folder & get_name) as text
	if (kind of (info for alias main_folder without size)) is "AVI-Film" then
		tell application "Finder"
			set oldtid to text item delimiters of AppleScript
			set text item delimiters of AppleScript to {"."}
			set movie_name to text 1 thru text item -2 of get_name
			set text item delimiters of AppleScript to oldtid
			set new_file to (alias_folder as text) & movie_name & ".mov"
		end tell
		
		tell application "QuickTime Player"
			open main_folder
			if (can export front document as QuickTime media link) then
				export front document to new_file as QuickTime media link
			else
				display dialog "QuickTime Player can't export “" & (main_folder as Unicode text) & "” as an Media Link." buttons "OK" default button 1 with icon caution
			end if
			close front document
		end tell
	end if
end prozess

ich verwende allerdings die export funktion.
und ich übergebe mehrer ordner, die das script auch nach einem unterordner durchsucht.
 
  • Gefällt mir
Reaktionen: usls1
Hallo,

gibts ne möglichkeit das dieses script die filmdateien als referenzfilm speichert und nicht als media link?

Gruss
matze
 
Was meinst du mit media link?
 
Zurück
Oben Unten