Code: Select all
#!/usr/bin/newlisp
(set 'text (exec "pbpaste"))
(replace {\.} text " " 0)
The following code also produces no output:
Code: Select all
#!/usr/bin/env newlisp
(set 'text (string (exec "pbpaste")))
(println (parse (replace {.} text " " 0) ""))
Code: Select all
#!/usr/bin/env newlisp
(set 'text (string (exec "pbpaste")))
(set 'text2 (parse (replace {.} text " ") ""))
(println text2)
(exit)
1. yes i can execute newlisp in the shell with either /usr/bin/newlisp or /usr/bin/env newlisp .
2. yes, the textexpander macro definition type is set to shell script.
the result of evaluating the first code block above in newlisp from the shell when i copy the string "Object.Oriented.Analysis." (without double quotes) is:
Code: Select all
> (set 'text (exec "pbpaste"))
("Object.Oriented.Analysis.")
> (replace "\." text " " 0)
(" ")
Code: Select all
> (set 'text (string (exec "pbpaste")))
"(\"Object.Oriented.Analysis.\")"
> (println (parse (replace {.} text " " 0) ""))
(" ")
(" ")
Code: Select all
> (set 'text (string (exec "pbpaste")))
"(\"Object.Oriented.Analysis.\")"
> (set 'text2 (parse (replace {.} text " ") ""))
("(\"Object Oriented Analysis \")")
> (println text2)
("(\"Object Oriented Analysis \")")
("(\"Object Oriented Analysis \")")