set enclosing folder to a variable

I have a varible within a Finder tell block called “folderOfTheTable”.
it produces a posix style reference to a folder on my disk.
I would like to go up a level in the hierarchy of my directory structure
ie change my variable to the folder that contains folderOfTheTable.
I’m trying this for example:

set theCurrentFolder to folderOfTheTable
set folderOfTheTable to folder (exists folder theCurrentFolder)

it doesn’t work
any ideas?

thanks
Peter

I’m not sure that this will work for you, but it uses the ‘container’ to get the parent of where ever this script is saved

on run
	set thePath to (path to me)
	tell application "Finder" to set theParent to container of thePath as text
	set myPath to POSIX path of theParent
	display dialog result
end run

thanks Greg this variation on your code work for me:

cheers,

Peter