How to hide OS X Finder commands in OS 9 script?

I’m trying to write some scriptlets that will manipulate files in Finder, such as make an archive copy of a file in an archive folder. I would like to have one script function in either OS 9 or OS X. I’ve gotten everything down the the common denominator, except for some of the OS X Finder commands that access OS X-specific properties of a file, specifically “name extension”, “extension hidden”, and “displayed name”.

I have this block in my script

	tell application "Finder"
		-- get the path to source file
		set srcPath to ((container of file srcFile) as string)
		
		-- get the displayed name, name extension, and extension display condition in OS X
		set finderVers to version
		(* 
		need to find a way to "block" these from compile process - OS 9 Finder complains 
		*)
		if (finderVers >= 10.2) then
			set nameExt to name extension of file srcFile
			set hiddenExt to extension hidden of file srcFile
			set dispName to displayed name of file srcFile
		end if -- {finderVers}
	end tell -- {Finder}

which works fine in OS X, but will not even compile in OS 9, unless I comment out the three lines enclosed in the “finderVers >= 10.2” block.

Is there a way that I can “hide” these statements from the compile process on OS 9, yet have them accessible for OS X?

I’ve tried moving them into a subroutine, without success. As I write this, it occurs to me that I should wrap it in a “try” statement, that I expect to fail on OS 9…

If anyone has a solution or other solutions for this, please let me know. I’m off to try the try…

I don’t know if this will help or not but it’s worth a shot.

using terms from application "Finder"
	tell application "Finder"
		-- get the path to source file 
		set srcPath to ((container of file srcFile) as string)
		
		-- get the displayed name, name extension, and extension display condition in OS X 
		set finderVers to version
		(* 
      need to find a way to "block" these from compile process - OS 9 Finder complains 
      *)
		if (finderVers ? 10.2) then
			try
				set nameExt to name extension of file srcFile
				set hiddenExt to extension hidden of file srcFile
				set dispName to displayed name of file srcFile
			end try
		end if -- {finderVers} 
	end tell -- {Finder} 
end using terms from 

– Rob