problem with handler

Hi all,
I’ve tried to create subroutine for frequently used operations


on sh(obj, op)
	if op = "qp" then return quoted form of POSIX path of (obj)
	if op = "qf" then return quoted form of (obj)
	if op = "pp" then return POSIX path of (obj)
end sh

and run it

set abc to sh(fileObject, "qp")

but AS displays an error
What’s wrong?

It’s always helpful to know which error :wink:

it says “can’t continue sh”

then the handler call is within a application tell block.
Either move the call outside the block or use the keyword my

set abc to my sh(fileObject, "qp")

Thanx again, StefanK!