prevChar = "(" or prevChar = "[" or prevChar = "{" or ¬
prevChar = "<" or prevChar = 171 or ¬
prevChar = character id 12296 or prevChar = character id 12298 or ¬
(prevChar = gLeftQuote and theChar = singleQuote) or ¬
(prevChar = gLeftApostrophe and theChar = doubleQuote) or ¬
isWhiteSpace(prevChar)) then
if theChar = singleQuote then
set theChar to gLeftApostrophe
else
set theChar to gLeftQuote
end if
else
if theChar = singleQuote then
set theChar to gRightApostrophe
else
set theChar to gRightQuote
end if
end if
set prevChar to theChar as string
end if
copy theChar to end of newString
end repeat
setString(newString as string)
return getString()
end smartenQuotes
-- file path utilities
on filename()
return lastToken("/")
end filename
on dirPath()
return beforeString(filename())
end dirPath
on fileExtension()
tell newString(filename())
return afterString(".")
end tell
end fileExtension
on fileBasename()
tell newString(filename())
return beforeString(".")
end tell
end fileBasename
end script
on display overlay text sourceText duration durationValue : 0 goose honk gooseHonkValue : false advanced settings advancedSettingsRecord : {}