CHECKING FOR QUICKTIME???

:?: IS IT POSSIBLE TO CHECK IF QUICKTIME IS INSTALLED ON THE INSERTION OF A CD AND IF IT IS, THEN PLAY A FLASH MOVIE, IF NOT PROMPT THEM TO INSTALL?

PLEASE HELP!

on gestaltVersion_info(gestalt_code, string_length)
	try
		tell application "Finder" to ¬
			copy my NumToHex((computer gestalt_code), ¬
				string_length) to {a, b, c, d}
		set the numeric_version to {a, b, c, d} as string
		if a is "0" then set a to ""
		set the version_string to (a & b & "." & c & "." & d) as string
		return {numeric_version, version_string}
	on error
		return {"", "unknown"}
	end try
end gestaltVersion_info

on NumToHex(hexData, stringLength)
	set hexString to {}
	repeat with i from stringLength to 1 by -1
		set hexString to ((hexData mod 16) as string) & hexString
		set hexData to hexData div 16
	end repeat
	return (hexString as string)
end NumToHex


copy my gestaltVersion_info("qtim", 8) to {QT_version, QT_string}
if the QT_version is less than "0505" then
	display dialog "This CD requires QuickTime 5.05 or higher." & ¬
		return & return & "The currently installed version is: " & ¬
		QT_string buttons {"Install", "Cancel"} default button 1
	if button returned of result = "Install" then
		copy my gestaltVersion_info("sysv", 4) to {system_version, system_string}
		
		if the system_version is less than "1000" then -- this checks for OS X 10.0.0 
			tell application "Finder" to open file "Marshall Fields:MacOS:QuickTime Installer" -- *** 
		else
			tell application "Finder" to open file "Marshall Fields:MacOSX:QuickTime Installer" -- *** 
		end if
		
	end if
else
	tell application "Finder" to open file "Marshall Fields:pucmac" -- *** 
	
end if

This is what I’ve come up with?!?

  1. Check version of Quicktime
  2. if no there check version of OS
  3. opens corresponding installer
    -or-
  4. runs Flash projector

Are the paths okay? The CD would be called “Marshall Fields” then the installers are in their own folders (MacOS, MacOSX).

Since it is only checking for the version of QT, What would happen if they didn’t have it? Would it prompt them as well? Any help would be great. Never done this before. Only have experience in JavaScript , HTML, and ActionScript!

HELP!

As you know, if you can run a script “on the insertion of a CD”, then you KNOW QuickTime is installed…
If it is not installed, you can’t launch your script nor prompt for QuickTime’s installation… :wink:

Hi :slight_smile:

I think that it is not very careful of launching files or applications with the action “auto start”…
They is very dangeureux because the viruses use this technique for this propagating.
See this link: Auto file execution vulnerability in Mac OS

But, if you want absolutely to launch a document by “auto start”, look at these adresses:
Add Autostart to your CD
AutoStart Utilities

Bye :rolleyes:

This works:

on gestaltVersion_info(gestalt_code, string_length)
	try
		tell application "Finder" to ¬
			copy my NumToHex((computer gestalt_code), ¬
				string_length) to {a, b, c, d}
		set the numeric_version to {a, b, c, d} as string
		if a is "0" then set a to ""
		set the version_string to (a & b & "." & c & "." & d) as string
		return {numeric_version, version_string}
	on error
		return {"", "unknown"}
	end try
end gestaltVersion_info

on NumToHex(hexData, stringLength)
	set hexString to {}
	repeat with i from stringLength to 1 by -1
		set hexString to ((hexData mod 16) as string) & hexString
		set hexData to hexData div 16
	end repeat
	return (hexString as string)
end NumToHex


copy my gestaltVersion_info("qtim", 8) to {QT_version, QT_string}
if the QT_version is less than "0602" then
	display dialog "This CD requires QuickTime 6.02 or higher." & ¬
		return & "The currently installed version is: " & ¬
		QT_string & ¬
		return & return & "Press 'Install' to continue...  " buttons {"Install", "Cancel"} default button 1
	if button returned of result = "Install" then
		copy my gestaltVersion_info("sysv", 4) to {system_version, system_string}
		
		if the system_version is less than "1000" then -- this checks for OS X 10.0.0 
			set AppleScript's text item delimiters to ":"
			set | folder which contains me | to text items 1 thru -2 of (path to me as text) & "" as text
			--> to go 1 level up, choose "text items 1 thru -3"; to go 2 levels up, "1 thru -4"; and so on... 
			set AppleScript's text item delimiters to {""}
			
			set qt_installer to | folder which contains me | & "MacOS:QuickTime Installer" as alias
			
			tell application "Finder" to open qt_installer
			
		else
			
			set AppleScript's text item delimiters to ":"
			set | folder which contains me | to text items 1 thru -2 of (path to me as text) & "" as text
			--> to go 1 level up, choose "text items 1 thru -3"; to go 2 levels up, "1 thru -4"; and so on... 
			set AppleScript's text item delimiters to {""}
			
			set qt_installerx to | folder which contains me | & "MacOSX:QuickTime.pkg" as alias
			
			tell application "Finder" to open qt_installerx
			
		end if
		
	end if
else
	
	set AppleScript's text item delimiters to ":"
	set | folder which contains me | to text items 1 thru -2 of (path to me as text) & "" as text
	--> to go 1 level up, choose "text items 1 thru -3"; to go 2 levels up, "1 thru -4"; and so on... 
	set AppleScript's text item delimiters to {""}
	
	set cd_interact to | folder which contains me | & "pucmac" as alias
	
	tell application "Finder" to open cd_interact
	
end if

:arrow: Is there a way to change any of the attributes like background color on the display dialog?
:arrow: And if anyone knows if this would still prompt the dialog box if Quicktime isn’t even there?

Thanks for all your help!

No with standard additions. You’d need here Dialog Director or similar osaxen (installed in the user’s machine or bundled with Applet Binder), or any GUI tool, such as FaceSpan.

http://bbs.applescript.net/viewtopic.php?p=13131#13131

maybe for the sake of the people that I plan to distribute my cd presentation, “auto start” is a bad idea. Can someone help me with an alternative? How about a folder action that shows only that file that is needed to start the flash movie? Can anybody help with that?

A folder action would depend on folder actions being enabled on the target computers, making it a less than 100% reliable solution. Mac users have a lot of control over automatic execution of code. It’s a security thing. :wink: