I would love a quick run-through on how to actually use DEVONthink Pro’s bundled Applescript for executing Perl scripts. I’m a novice to both Perl and Applescript, but am trying to learn.
Looking at part of the script (edited down a bit):
set this_source to text of think window 1 as string try if length of this_source > 0 then set this_path to quoted form of "/tmp/DEVONthink Pro/_temp_.pl" do shell script "echo " & quoted form of this_source & ">" & this_path do shell script "perl " & this_path end if
It looks like I should have a text document in DT Pro that’s a valid Perl script, select Execute Perl Script off the Script menu, and then the script should execute after being copied into a tmp directory temp.pl file, right?
Where does any printed output go?
Could you give a simple “hello world” example?
Is it possible to send it another DEVONthink text file, or text clipboard contents, to the Perl script as an input?
I tossed in a simple:
#!/usr/bin/perl use strict; use warnings; print "Hello world\n"; exit;
…and tried to execute it, but nothing happened.