Open a file from a relative path - sort of

I would like to be able to open a file from a particular folder above a selected file. The file I wish to open will always be in the ‘Setups’ folder. I will always open this file (ProductionLog) from a file somewhere within the Setups folder, however the file I open it from may be one, two, three, etc levels lower (in sub folders) below the Setups folder.

So ideally I have apple script just keep backing up until it finds the Setups folder and the file called ProductionLog.

Any thoughts?

Thanks
David

Hi,

try this, the reference to the requested file is in the variable productionLogFile.
The check for class disk is to avoid an infinite loop


tell application "Finder"
	set aSelection to selection
	if aSelection is not {} then
		set theFolder to folder of item 1 of aSelection
		repeat until name of theFolder is "Setups" or class of theFolder is disk
			set theFolder to container of theFolder
		end repeat
		set productionLogFile to file "ProductionLog" of theFolder
	end if
end tell