an interesting challenge: 10.3.9 script failure vs success in 10.4.9

hi gang,

i’ve got a simple script which works great in 10.4.x but will not run in 10.3.x. i can’t figure out why although i’m sure it’s due to syntax on the different applescript versions. here’s the script and i’d appreciate any expertise as i’m a beginner at designing scripts:

tell application "Finder"
	set msg to "FileMaker Pro 8.5 has been successfully deployed to your Macintosh. For your convenience, an icon will also be added to your dock. If you experience problems launching the new software, please call the helpdesk.
	
Many thanks from the ITS Mac Team."
	display alert "Notice from: ITS" message msg
	
end tell

many thanks,
david koff
dkoff AT getty DOT edu

Hi David,

the reason is, display alert was introduced in Tiger.
display dialog works also in Panther.

stefan,

many thanks for that syntax tip. although the now revised script is graphically less sexy. is there a way to include graphics in the window on this pop up message? the revised script:

tell application "Finder"
	display dialog "Notice from: The ITS Lab

FileMaker Pro 8.5 has been successfully deployed to your Macintosh. For your convenience, an icon will also be added to your dock. If you experience problems launching the new software, please call the helpdesk at x1199.

Many thanks from the ITS Mac Team."
end tell

Not really, but you can add the FM icon like

property FMPath : (path to applications folder as string) & "FileMaker Pro 8.5 Advanced:FileMaker Pro Advanced.app"
set FMicon to path to resource "FMApp.icns" in bundle (FMPath as alias) -- this avoids FM to launch
tell application "Finder"
	display dialog "Notice from: The ITS Lab

FileMaker Pro 8.5 has been successfully deployed to your Macintosh. For your convenience, an icon will also be added to your dock. If you experience problems launching the new software, please call the helpdesk at x1199.

Many thanks from the ITS Mac Team." with icon FMicon
end tell

If FM Pro is somewhere else or has a different name you must adjust the path

path to resource was also added in Tiger. :wink:

Darn!

Then take the “extended” version

set FMicon to alias ((path to applications folder as string) & "FileMaker Pro 8.5 Advanced:FileMaker Pro Advanced.app:Contents:Resources:FMApp.icns")

stefan,

thank you. even this added icon adds a bit of splash that looks much better, so thank you!

david

You can also have it check to see what system is running and make a “Universal” script.


if ((system attribute "sysv") ≥ 4160) then
	tell application "Finder"
		set msg to ("FileMaker Pro 8.5 has been successfully deployed to your Macintosh. For your convenience, an icon will also be added to your dock. If you experience problems launching the new software, please call the helpdesk." & return & return & "Many thanks from the ITS Mac Team.")
		display alert "Notice from: ITS" message msg
	end tell
else --system is earlier than Tiger
	tell application "Finder"
		display dialog ("Notice from: The ITS Lab" & return & return & "FileMaker Pro 8.5 has been successfully deployed to your Macintosh. For your convenience, an icon will also be added to your dock. If you experience problems launching the new software, please call the helpdesk at x1199." & return & return & "Many thanks from the ITS Mac Team.")
	end tell
end if


Browser: Safari 419.3
Operating System: Mac OS X (10.4)