loading copies of nibs depending on system version

Forgive me for trying this from a few angles. I’m hung up on the fact that the date picker causes a crash pre-tiger.

one possibility I thought of is to load a separate nib depending on what system version.

what i’ve tried so far is:

  1. make 2 copies of mainmenu.nib, calling one panther.nib and the other tiger.nib
  2. delete the windows from mainmenu.nib leaving basically the file owner, first responder, and main menu.
  3. in script,

on will finish launching
tell application “Finder” to if version ≥ “10.4” then
set hastiger to true
end if
if hastiger then
set thenib to load nib “Tiger”
else
set thenib to load nib “Panther”
end if
end will finish launching

on awake from nib
– example command:
set the current tab view item of tab view “maintabs” of window “Main” of thenib to tab view item “maintab” of tab view “maintabs” of window “Main” of thenib
end awake from nib

that gives an error of thenib is not defined.

without thenib at the end of that line, ns receiver error.

then there are also connection questions. unless i UNCHECK the script in file’s owner for both tiger.nib and panther.nib, I’m getting AppleScript Error -2706 when I launch it. are there any other connection issues I should be watching for, in file’s owner, in first responder, and in applescript info (what is that anyway)?

thanks!

Jon gave me some hints in another thread:

http://bbs.applescript.net/viewtopic.php?pid=42946

Based on those I’ve figured out what the problem was… Connections.

                             File's Owner                    AppleScript Info          Contains

mainmenu.nib connected* not connected file’s owner, first responder, main menu, applescript info, dummy window (could not delete original window)

tiger.nib not connected connected file’s owner, first responder, main window (with date picker), applescript info

panther.nib not connected connected file’s owner, first responder, main window (w/o date picker), applescript info

  • connected to will finish launching and awake from nib

again jon thanks!

GRRRR…

not quite good to go here.

for some reason the will quit and should quit handlers are not working. they are connected in the applications section of the first responder of the mainmenu.nib, which just contains the menu. (see above). they are NOT connected in the other nib files.

what’s going on?

edit:

the launched connection does not seem to work when it is connected to the first responder of mainmenu.nib either. something weird is going on here… obviously ‘will finish launching’ is connected, because that’s what loads the other two nibs.

this makes me tear my hair out!

set verzion to do shell script "sw_vers|grep ProductVersion|awk '{print $2}'"
	if verzion < 10.3 then
		show window "jaguar"
	else if verzion < 10.4 then
		show window "Jaguar"
	else if verzion < 10.5 then
		show window "Tiger"
end if