Por favor, que alguien me ayude y me muestre cómo conseguir que esto funcione. He comprobado ejemplos sobre la devolución de valores de las funciones con este AppleScript, pero algo me falta aquí.
Estoy intentando que la función, strTest(), pase una cadena que luego se imprimirá en el editor BBEdit. Si sustituyera la variable por una cadena estática, funcionaría. Pero esto no funciona en absoluto. Me sale: "La variable theText no está definida".
¿Alguien ve lo que está pasando?
on strTest()
set returntest to "this is a test"
return returntest
end strTest
tell application "BBEdit"
set theText to strTest()
tell window 1
set insertionP to get selection
set text of insertionP to (theText & (text of insertionP))
end tell
end tell