Presenting multiple quicktime videos at once

OK, so long story short, I’m trying to create a stress script for some work

that script will play up to 12 quicktime videos at any one point. It can organise them all via tiles based on the # of windows and thats all fine. But I also want them to use quicktime x’s presentation feature to set them all to full screen.

I have a ghetto script that fullscreens them all very poorly, but I’d really prefer something more efficient, as well as getting them to close.

currently the script that I’ve been trying to use looks like this


tell application "QuickTime Player"
	
	
	try
		
		set doc1 to document 1
		set doc2 to document 2
		set doc3 to document 3
		set doc4 to document 4
		set doc5 to document 5
		set doc6 to document 6
		set doc7 to document 7
		set doc8 to document 8
		set doc9 to document 9
		set doc10 to document 10
		set doc11 to document 11
		set doc12 to document 12
	end try
	
	try
		set presenting of doc1 to true
		delay 5
		set presenting of doc2 to true
		delay 5
		set presenting of doc3 to true
		delay 5
		set presenting of doc4 to true
		delay 5
		set presenting of doc5 to true
		delay 5
		set presenting of doc6 to true
		delay 5
		set presenting of doc7 to true
		delay 5
		set presenting of doc8 to true
		delay 5
		set presenting of doc9 to true
		delay 5
		set presenting of doc10 to true
		delay 5
		set presenting of doc11 to true
		delay 5
		set presenting of doc12 to true
		delay 5
		
		
		
		
		set presenting of doc1 to false
		delay 5
		set presenting of doc2 to false
		delay 5
		set presenting of doc3 to false
		delay 5
		set presenting of doc4 to false
		delay 5
		set presenting of doc5 to false
		delay 5
		set presenting of doc6 to false
		delay 5
		set presenting of doc7 to false
		delay 5
		set presenting of doc8 to false
		delay 5
		set presenting of doc9 to false
		delay 5
		set presenting of doc10 to false
		delay 5
		set presenting of doc11 to false
		delay 5
		set presenting of doc12 to false
		delay 5
		
	end try
	
	
end tell


This doesn’t open every single window after window 6-9 depending
I know that using document ID’s like this must be inefficient, and creating variables in this obtuse way must not be very clean.

using quicktime x and 10.8 (but this should work in 10.7 for sure.

thanks for the help. I feel like I’m banging my head against a wall so hard trying to figure this out. I know that I could solve this multi variable thing in python inside a program python runs in but I’m new to doing things like this in Applescript.

Hi,

does this help?

tell application "QuickTime Player"
	activate
	repeat with i from 1 to count of documents
		set presenting of document i to true
		delay 5
	end repeat
	
	repeat with i from 1 to count of documents
		set presenting of document i to false
		delay 5
	end repeat
end tell

Thanks,
Nik

Thanks for the help, this is definitely a lot cleaner of a script, sadly it still doesn’t work. I can’t get it to work consistently even with 3 windows let alone 12, and even adding an extra delay and kick back to the finder doesn’t get them all to even open.

I came up with a working solution for full screening all the windows but sadly the reverse isn’t working.

This one tells all the windows to open

tell application "QuickTime Player"
    set ptrue to (documents whose presenting is true) count
    set pfalse to (documents whose presenting is false) count
    repeat with i from 1 to pfalse
        set docpfalse to (first document whose presenting is false)
        activate docpfalse
        set presenting of docpfalse to true
        delay 5
        tell application "Finder"
            activate
        end tell
        delay 1
        
    end repeat
    
end tell

but doing the reverse MAYBE gets 3 windows to un fulscreen.

oh quicktime x how I hate you.

The issue as I have it is once presenting quicktime really just doesn’t understand how to access said video. It knows it’s presenting, but I can set a variable to the first presenting window, and then have quicktime set the presenting of that window to false and it may not actually stop presenting, alternatively quicktime doesn’t always make the window stop presenting correctly just using key commands, as I tried using system events to do this to same reselut.

so then I tried resizing using

 natural dimensions

definition, and quicktime no matter who many times I try refuses to set the window back to it’s natural dimensions.

Seriously, this program is going to give me an aneurism.

Hello.

I hope you succeed with your endavours.

You should be able to resize a window using system events, with something like this, but I don’t know for sure since I have never scripted Quicktime really, but this works on most applications that has a scripting dictionary.

tell application id "com.apple.systemevents"
			tell application process "QUICKTIME"
				set position of window 1 to {newX, newY}
				set size of window 1 to {wwidth, wheight}
			end tell
		end tell

You’ll have to rework it a little of course. :slight_smile:

Hi,

It’s been a while since I’ve scripted QT Player. I can’t get more than one window to Present at the same time, but you can try playing the movie after presenting it.

gl,

Hi,

I made a folder on my desktop with 5 movies in it. This scripts seems to play the five movies consistently. I ran it several times. I’ll try to add more movies to it later.


set f to choose folder
tell application "Finder"
	set file_list to (every file of f) as alias list
end tell

tell application "QuickTime Player"
	activate
	
	set doc_list to {}
	repeat with i from 1 to 5
		set this_file to item i of file_list
		set end of doc_list to (open this_file)
	end repeat
	repeat with this_doc in doc_list
		present this_doc
		play this_doc
		delay 5
		set presenting of this_doc to false
		delay 2
	end repeat
	
end tell

Editted: maybe you need the short delay (2 secs for mine) when unpresenting it.

gl,

Model: MBP
AppleScript: 2.2.3
Browser: Safari 536.26.17
Operating System: Mac OS X (10.8)

Hi,

This new script just played sll 12 files.


set f to choose folder
tell application "Finder"
	set file_list to (every file of f) as alias list
end tell
set n to count file_list
tell application "QuickTime Player"
	activate
	
	set doc_list to {}
	repeat with i from 1 to n
		set this_file to item i of file_list
		set end of doc_list to (open this_file)
		delay 1
	end repeat
	repeat with this_doc in doc_list
		present this_doc
		play this_doc
		delay 5
		set presenting of this_doc to false
		delay 2
	end repeat
	
end tell


It still needs to be tested more.

gl,

Nice work, kel1, this is something to work with, for sure, but as you noted not quite what I had in mind.

and MCusrII this script doesn’t work, I always get “System Events got an error: Can’t set application process “QUICKTIME” to {1920, 480}.” which is basically the same error I get for anything. Doesn’t matter the size, if it’s the actual window size etc.

To give every one an idea of what I’m doing already, here is the entire quicktime section of the script. It’s very long so sorry about that, and there is definitely some stuff I could make a little cleaner (play and loop) but thats easy to come back and re work (though any advice is good)

This is actually from several sections of the script amalgamated, there are another few hundred lines in there for dealing with things like system info sniffing and more.

as you can see everything plays and tiles fine, I just want to be able to toss it in a loop of playing from the tiled view to all full screened and then back.

The fullscreening and un fullscreening isn’t part of this script

[side note, if you’re looking for test quicktime files I recommend trailers.apple.com]



-- variables

tell application "Finder"
	set scr_size to bounds of window of desktop
	set scr_width to item 3 of scr_size
	set scr_height to item 4 of scr_size
end tell

set Compensation_A to 11
set Compensation_B to 14
set Compensation_C to 7




set DP to ((path to desktop folder) & "vidstress") as string

tell application "Finder"
	open (every file of folder DP)
end tell
delay 10
--arange all windows


set volume with output muted


tell application "QuickTime Player"
	set open_windows to (every window where visible is true)
	set n to count of open_windows
	
	-- Next we play all windows
	
	try
		
		play document 1
		play document 2
		play document 3
		play document 4
		play document 5
		play document 6
		play document 7
		play document 8
		play document 9
		play document 10
		play document 11
		play document 12
	end try
	
	
	-- next we loop
	try
		
		set the looping of document 1 to true
		set the looping of document 2 to true
		set the looping of document 3 to true
		set the looping of document 4 to true
		set the looping of document 5 to true
		set the looping of document 6 to true
		set the looping of document 7 to true
		set the looping of document 8 to true
		set the looping of document 9 to true
		set the looping of document 10 to true
		set the looping of document 11 to true
		set the looping of document 12 to true
		
	end try
	
	
	
	
	
	
	
	
	
	if n = 1 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 2 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, scr_width / 2, scr_height}
			end tell
			activate
			tell window 2
				set bounds to {scr_width / 2, 0, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 3 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, scr_width / 2, scr_height}
			end tell
			activate
			tell window 2
				set bounds to {((scr_width / 4) * 2), 0, scr_width, (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 3
				set bounds to {((scr_width / 4) * 2), (scr_height / 2) + Compensation_A, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 4 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, ((scr_width / 4) * 2), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 2
				set bounds to {((scr_width / 4) * 2), 0, scr_width, (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 3
				set bounds to {0, (scr_height / 2) + Compensation_A, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {((scr_width / 4) * 2), (scr_height / 2) + Compensation_A, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 5 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, ((scr_width / 4) * 2), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 2
				set bounds to {0, (scr_height / 2) + Compensation_A, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 3
				set bounds to {((scr_width / 4) * 2), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 4
				set bounds to {((scr_width / 4) * 2), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 6 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, ((scr_width / 4) * 2), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 3
				set bounds to {0, (scr_height / 3) + Compensation_B, ((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {0, ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 2
				set bounds to {((scr_width / 4) * 2), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 4
				set bounds to {((scr_width / 4) * 2), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 6
				set bounds to {((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 7 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, (scr_width / 3), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 2
				set bounds to {(scr_width / 3), 0, ((scr_width / 3) * 2), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 3
				set bounds to {0, (scr_height / 2) + Compensation_A, (scr_width / 3), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 3), (scr_height / 2) + Compensation_A, ((scr_width / 3) * 2), scr_height}
			end tell
			activate
			tell window 5
				set bounds to {((scr_width / 3) * 2), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 6
				set bounds to {((scr_width / 3) * 2), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 3) * 2), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 8 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, (scr_width / 3), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 2
				set bounds to {0, (scr_height / 2) + Compensation_A, (scr_width / 3), scr_height}
			end tell
			activate
			tell window 3
				set bounds to {(scr_width / 3), 0, ((scr_width / 3) * 2), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 3), (scr_height / 3) + Compensation_B, ((scr_width / 3) * 2), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {(scr_width / 3), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 3) * 2), scr_height}
			end tell
			activate
			tell window 6
				set bounds to {((scr_width / 3) * 2), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 3) * 2), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 8
				set bounds to {((scr_width / 3) * 2), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 9 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, (scr_width / 3), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 2
				set bounds to {0, (scr_height / 3) + Compensation_B, (scr_width / 3), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 3
				set bounds to {0, ((scr_height / 3) * 2) + Compensation_C, (scr_width / 3), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 3), 0, ((scr_width / 3) * 2), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {(scr_width / 3), (scr_height / 3) + Compensation_B, ((scr_width / 3) * 2), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 6
				set bounds to {(scr_width / 3), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 3) * 2), scr_height}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 3) * 2), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 8
				set bounds to {((scr_width / 3) * 2), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 9
				set bounds to {((scr_width / 3) * 2), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 10 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, (scr_width / 4), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 2
				set bounds to {(scr_width / 4), 0, ((scr_width / 4) * 2), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 3
				set bounds to {0, (scr_height / 2) + Compensation_A, (scr_width / 4), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 4), (scr_height / 2) + Compensation_A, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 5
				set bounds to {((scr_width / 4) * 2), 0, ((scr_width / 4) * 3), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 6
				set bounds to {((scr_width / 4) * 2), (scr_height / 3) + Compensation_B, ((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 3), scr_height}
			end tell
			activate
			tell window 8
				set bounds to {((scr_width / 4) * 3), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 9
				set bounds to {((scr_width / 4) * 3), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 10
				set bounds to {((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 11 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, ((scr_width / 4) * 2), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 2
				set bounds to {0, (scr_height / 3) + Compensation_B, (scr_width / 4), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 3
				set bounds to {0, ((scr_height / 3) * 2) + Compensation_C, (scr_width / 4), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 4), (scr_height / 3) + Compensation_B, ((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {(scr_width / 4), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 6
				set bounds to {((scr_width / 4) * 2), 0, ((scr_width / 4) * 3), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 4) * 2), (scr_height / 3) + Compensation_B, ((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 8
				set bounds to {((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 3), scr_height}
			end tell
			activate
			tell window 9
				set bounds to {((scr_width / 4) * 3), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 10
				set bounds to {((scr_width / 4) * 3), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 11
				set bounds to {((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 12 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, (scr_width / 4), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 2
				set bounds to {0, (scr_height / 3) + Compensation_B, (scr_width / 4), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 3
				set bounds to {0, ((scr_height / 3) * 2) + Compensation_C, (scr_width / 4), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 4), 0, ((scr_width / 4) * 2), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {(scr_width / 4), (scr_height / 3) + Compensation_B, ((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 6
				set bounds to {(scr_width / 4), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 4) * 2), 0, ((scr_width / 4) * 3), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 8
				set bounds to {((scr_width / 4) * 2), (scr_height / 3) + Compensation_B, ((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 9
				set bounds to {((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 3), scr_height}
			end tell
			activate
			tell window 10
				set bounds to {((scr_width / 4) * 3), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 11
				set bounds to {((scr_width / 4) * 3), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 12
				set bounds to {((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	
	
	--end arangment
	

	
end tell


Model: MBPr 15"
AppleScript: 2.5.1
Browser: Safari 537.31
Operating System: Mac OS X (10.8)

ended up integrating your script,

here’s the video only part of my script with kel’s additions.


-- Variable setup & System info
tell application "Finder"
	set scr_size to bounds of window of desktop
	set scr_width to item 3 of scr_size
	set scr_height to item 4 of scr_size
end tell

set Compensation_A to 11
set Compensation_B to 14
set Compensation_C to 7



set DP to choose folder with prompt "Please choose the folder you have stored your test videos in and would like to use to begin video stress testing.







" default location (path to desktop folder) as alias

--open and play


tell application "Finder"
	set file_list to (every file of DP) as alias list
end tell
set nc to count file_list
tell application "QuickTime Player"
	activate
	
	set doc_list to {}
	repeat with i from 1 to nc
		set this_file to item i of file_list
		set end of doc_list to (open this_file)
		delay 1
	end repeat
	set open_windows to (every window where visible is true)
	set n to count of open_windows
	
	-- Next we play all windows
	
	try
		
		play document 1
		play document 2
		play document 3
		play document 4
		play document 5
		play document 6
		play document 7
		play document 8
		play document 9
		play document 10
		play document 11
		play document 12
	end try
	
	
	-- next we loop
	try
		
		set the looping of document 1 to true
		set the looping of document 2 to true
		set the looping of document 3 to true
		set the looping of document 4 to true
		set the looping of document 5 to true
		set the looping of document 6 to true
		set the looping of document 7 to true
		set the looping of document 8 to true
		set the looping of document 9 to true
		set the looping of document 10 to true
		set the looping of document 11 to true
		set the looping of document 12 to true
		
	end try
	
	
	
	
	
	
	-- aranagment	
	
	
	if n = 1 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 2 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, scr_width / 2, scr_height}
			end tell
			activate
			tell window 2
				set bounds to {scr_width / 2, 0, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 3 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, scr_width / 2, scr_height}
			end tell
			activate
			tell window 2
				set bounds to {((scr_width / 4) * 2), 0, scr_width, (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 3
				set bounds to {((scr_width / 4) * 2), (scr_height / 2) + Compensation_A, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 4 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, ((scr_width / 4) * 2), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 2
				set bounds to {((scr_width / 4) * 2), 0, scr_width, (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 3
				set bounds to {0, (scr_height / 2) + Compensation_A, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {((scr_width / 4) * 2), (scr_height / 2) + Compensation_A, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 5 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, ((scr_width / 4) * 2), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 2
				set bounds to {0, (scr_height / 2) + Compensation_A, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 3
				set bounds to {((scr_width / 4) * 2), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 4
				set bounds to {((scr_width / 4) * 2), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 6 then
		tell application "QuickTime Player"
			activate
			tell window 1
				set bounds to {0, 0, ((scr_width / 4) * 2), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 3
				set bounds to {0, (scr_height / 3) + Compensation_B, ((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {0, ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 2
				set bounds to {((scr_width / 4) * 2), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 4
				set bounds to {((scr_width / 4) * 2), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 6
				set bounds to {((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 7 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, (scr_width / 3), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 2
				set bounds to {(scr_width / 3), 0, ((scr_width / 3) * 2), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 3
				set bounds to {0, (scr_height / 2) + Compensation_A, (scr_width / 3), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 3), (scr_height / 2) + Compensation_A, ((scr_width / 3) * 2), scr_height}
			end tell
			activate
			tell window 5
				set bounds to {((scr_width / 3) * 2), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 6
				set bounds to {((scr_width / 3) * 2), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 3) * 2), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 8 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, (scr_width / 3), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 2
				set bounds to {0, (scr_height / 2) + Compensation_A, (scr_width / 3), scr_height}
			end tell
			activate
			tell window 3
				set bounds to {(scr_width / 3), 0, ((scr_width / 3) * 2), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 3), (scr_height / 3) + Compensation_B, ((scr_width / 3) * 2), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {(scr_width / 3), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 3) * 2), scr_height}
			end tell
			activate
			tell window 6
				set bounds to {((scr_width / 3) * 2), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 3) * 2), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 8
				set bounds to {((scr_width / 3) * 2), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 9 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, (scr_width / 3), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 2
				set bounds to {0, (scr_height / 3) + Compensation_B, (scr_width / 3), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 3
				set bounds to {0, ((scr_height / 3) * 2) + Compensation_C, (scr_width / 3), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 3), 0, ((scr_width / 3) * 2), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {(scr_width / 3), (scr_height / 3) + Compensation_B, ((scr_width / 3) * 2), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 6
				set bounds to {(scr_width / 3), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 3) * 2), scr_height}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 3) * 2), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 8
				set bounds to {((scr_width / 3) * 2), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 9
				set bounds to {((scr_width / 3) * 2), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 10 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, (scr_width / 4), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 2
				set bounds to {(scr_width / 4), 0, ((scr_width / 4) * 2), (scr_height / 2) - Compensation_A}
			end tell
			activate
			tell window 3
				set bounds to {0, (scr_height / 2) + Compensation_A, (scr_width / 4), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 4), (scr_height / 2) + Compensation_A, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 5
				set bounds to {((scr_width / 4) * 2), 0, ((scr_width / 4) * 3), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 6
				set bounds to {((scr_width / 4) * 2), (scr_height / 3) + Compensation_B, ((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 3), scr_height}
			end tell
			activate
			tell window 8
				set bounds to {((scr_width / 4) * 3), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 9
				set bounds to {((scr_width / 4) * 3), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 10
				set bounds to {((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 11 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, ((scr_width / 4) * 2), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 2
				set bounds to {0, (scr_height / 3) + Compensation_B, (scr_width / 4), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 3
				set bounds to {0, ((scr_height / 3) * 2) + Compensation_C, (scr_width / 4), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 4), (scr_height / 3) + Compensation_B, ((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {(scr_width / 4), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 6
				set bounds to {((scr_width / 4) * 2), 0, ((scr_width / 4) * 3), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 4) * 2), (scr_height / 3) + Compensation_B, ((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 8
				set bounds to {((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 3), scr_height}
			end tell
			activate
			tell window 9
				set bounds to {((scr_width / 4) * 3), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 10
				set bounds to {((scr_width / 4) * 3), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 11
				set bounds to {((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	if n = 12 then
		tell application "QuickTime Player"
			activate
			activate
			tell window 1
				set bounds to {0, 0, (scr_width / 4), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 2
				set bounds to {0, (scr_height / 3) + Compensation_B, (scr_width / 4), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 3
				set bounds to {0, ((scr_height / 3) * 2) + Compensation_C, (scr_width / 4), scr_height}
			end tell
			activate
			tell window 4
				set bounds to {(scr_width / 4), 0, ((scr_width / 4) * 2), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 5
				set bounds to {(scr_width / 4), (scr_height / 3) + Compensation_B, ((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 6
				set bounds to {(scr_width / 4), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 2), scr_height}
			end tell
			activate
			tell window 7
				set bounds to {((scr_width / 4) * 2), 0, ((scr_width / 4) * 3), (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 8
				set bounds to {((scr_width / 4) * 2), (scr_height / 3) + Compensation_B, ((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 9
				set bounds to {((scr_width / 4) * 2), ((scr_height / 3) * 2) + Compensation_C, ((scr_width / 4) * 3), scr_height}
			end tell
			activate
			tell window 10
				set bounds to {((scr_width / 4) * 3), 0, scr_width, (scr_height / 3) - Compensation_C}
			end tell
			activate
			tell window 11
				set bounds to {((scr_width / 4) * 3), (scr_height / 3) + Compensation_B, scr_width, ((scr_height / 3) * 2) + Compensation_C}
			end tell
			activate
			tell window 12
				set bounds to {((scr_width / 4) * 3), ((scr_height / 3) * 2) + Compensation_C, scr_width, scr_height}
			end tell
		end tell
	end if
	
	delay 10
	
	
	
	
	--end arangment
	
	----	presenting
	repeat
		repeat with this_doc in doc_list
			present this_doc
			delay 15
			set presenting of this_doc to false
			delay 2
		end repeat
	end repeat
end tell





and just realized how stupid my play/loop commands were once I really looked at them


	-- Next we play, loop, mute  all windows
	
	play every document
	set the looping of every document to true
	set the audio volume of every document to 0
	
	
	

Let me see if I’m getting this right. What you’re saying is that the windows tile and play alright. But, when you ‘Present’ a movie, then unpresent it, sometimes the movie doesn’t go back to its original bounds?

Editted: removed location.

It’s two fold,

Once presenting QuickTime x has issues both in presenting every window, though you can run a line at the end of the script that clearly states that QuickTime knows there are still windows presenting, and at the same time when I’m presenting some windows when multiple are presented ( this is not an issue with your script) some times even when doing this manually QuickTime doesn’t actually re set the bounds of the window correctly and the only way to fix it is to present and unpresent the window. This happens within as few as 3 windows, but not every time.

Honestly I think given the issues what you have created is the best possible option, as the rational ways of doing this aren’t being inhibited by bad code in apple script but issues with QuickTime x

Try this. Is it supposed to be something like this?


set f to choose folder
tell application "Finder"
	set file_list to (every file of f) as alias list
end tell
set n to count file_list
set the_bounds to {{0, 0, 300, 200}, {300, 0, 600, 200}, {600, 0, 900, 200}, {900, 0, 1200, 200}, {0, 200, 300, 400}, {300, 200, 600, 400}, {600, 200, 900, 400}, {900, 200, 1200, 400}, {0, 400, 300, 600}, {300, 400, 600, 600}, {600, 400, 900, 600}, {900, 400, 1200, 600}}
tell application "QuickTime Player"
	activate
	set doc_list to {}
	repeat with i from 1 to n
		set this_file to item i of file_list
		set this_doc to (open this_file)
		set end of doc_list to this_doc
		set this_bounds to item i of the_bounds
		set bounds of front window to this_bounds
		set looping of this_doc to true
		play this_doc
	end repeat
	repeat with this_doc in doc_list
		present this_doc
		delay 5
		set presenting of this_doc to false
		delay 2
	end repeat
end tell
-- 1440, 900

When the choose folder dialog comes out, choose a folder with 12 movies. I just ran it 1 times so far and it seems to work ok. It sounds like you’re trying to fullscreen more than one movie at a time, but I don’t think you can do that. Although, in the past, the fullscreen didn’t work well at times. Now it seems alright to me, so far.

gl,

Added muting:


property the_bounds : {{0, 0, 300, 200}, {300, 0, 600, 200}, {600, 0, 900, 200}, {900, 0, 1200, 200}, {0, 200, 300, 400}, {300, 200, 600, 400}, {600, 200, 900, 400}, {900, 200, 1200, 400}, {0, 400, 300, 600}, {300, 400, 600, 600}, {600, 400, 900, 600}, {900, 400, 1200, 600}}

set f to choose folder
tell application "Finder"
	set file_list to (every file of f) as alias list
end tell
set n to count file_list

tell application "QuickTime Player"
	activate
	set doc_list to {}
	repeat with i from 1 to n
		set this_file to item i of file_list
		set this_doc to (open this_file)
		set end of doc_list to this_doc
		set this_bounds to item i of the_bounds
		set bounds of front window to this_bounds
		set looping of this_doc to true
		set muted of this_doc to true
		play this_doc
	end repeat
	repeat with this_doc in doc_list
		set muted of this_doc to false
		present this_doc
		delay 5
		set presenting of this_doc to false
		delay 2
		set muted of this_doc to true
	end repeat
	set muted of (item 1 of doc_list) to false
end tell
-- 1440, 900 my desktop bounds

Editted: ran it more than ten times, experimenting with the mute and it looks good to go almost. :slight_smile:

Editted: added QuickTime version to my system info

gl,

Model: MBP
AppleScript: 2.2.3
Browser: Safari 536.26.17
Operating System: Mac OS X (10.8)
QuickTime: Version 10.2 (603.12)

This is awesome, but actually it’s exactly what I was needing

the issues I’m having aren’t present in your script, or the last ones I posted.

The issue happens when multiple quicktime videos are presented simultaneously, not one by one.

I like your script though, thanks I’m going to have to look at how your setting your bounds, though if you notice my script it does it based on windows to account for making them take up the most size.

Hi zndr,

Glad you liked it. The reason I put the bounds list as a property at the top of the script was, because it’s easy to modify at that location. Again, logic tells me, that you can’t fullscreen more then one movie at the same time. When I try to do that I get some beeps from QuickTime telling me that I did something wrong. It doesn’t error though, but just warns you that you did something wrong.

gl,

See I can run all 12 in presentation thats not the issue, it’s un presenting thats having the issue. I honestly think, like I said, quicktime is at fault for not functioning correctly.

I don’t get it. I can’t present more than one movie at the same time. What happens when you present two movies at the same time? Do both movies show up in the full screen and how?

Heres what it looks like

this works using this script every time 100%

tell application "QuickTime Player"
	set ptrue to (documents whose presenting is true) count
	set pfalse to (documents whose presenting is false) count
	repeat with i from 1 to pfalse
		set docpfalse to (first document whose presenting is false)
		activate docpfalse
		set presenting of docpfalse to true
		delay 5
		tell application "Finder"
			activate
		end tell
		delay 1
		
	end repeat
	
end tell

I still don’t see two movies in full screen at the same time. All it does is go backwards through the list of movies presenting and unpresenting. I’ll have to look again at this tomorrow.