Hello,
I started using the GTDAlt bundle and I wrote a Quicksilver action in applescript to append text to my inbox.txt. I know I can just use Quicksilver's append text but I wanted to write something custom. The problem is it is adding invisible characters between every letter. Any ideas why?
Here's my script:
using terms from application "Quicksilver" on process text theText set this_file to (((path to desktop folder) as text) & "GTD:" & "inbox.txt") my write_to_file(theText, this_file, true) end process text end using terms from
on write_to_file(theText, target_file, append_data) try set the target_file to the target_file as text set the open_target_file to ¬ open for access file target_file with write permission if append_data is false then ¬ set eof of the open_target_file to 0 write theText to the open_target_file starting at eof close access the open_target_file return true on error try close access file target_file end try return false end try end write_to_file
Warmest regards,
Graham English
On 14. May 2007, at 06:21, Graham English wrote:
I started using the GTDAlt bundle and I wrote a Quicksilver action in applescript to append text to my inbox.txt. I know I can just use Quicksilver's append text but I wanted to write something custom. The problem is it is adding invisible characters between every letter. Any ideas why?
Try run ‘xxd’ on the file to figure out which characters got inserted. That might help diagnosing the problem.
I never figured out why it happened, but I managed to fix it. I used 'do shell script "echo "' which simplified the script and got it to work. The full script is here: http://integral.grahamenglish.net/ graham-english/append-to-inbox-quicksilver-action/
Thanks for your help.
On May 14, 2007, at 6:38 AM, Allan Odgaard wrote:
On 14. May 2007, at 06:21, Graham English wrote:
I started using the GTDAlt bundle and I wrote a Quicksilver action in applescript to append text to my inbox.txt. I know I can just use Quicksilver's append text but I wanted to write something custom. The problem is it is adding invisible characters between every letter. Any ideas why?
Try run ‘xxd’ on the file to figure out which characters got inserted. That might help diagnosing the problem.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate