AppleScript cannot find files inside the DT database when their paths are 
changed to aliases.  So, no luck there.

QuickKeys is happy to run the script with the errors remaining, so I've 
emulated the behavior of QS by blacklisting DEVONthink from the QS trigger 
and whitelisting DEVONthink on an identical QK trigger.  All's well.  It 
would be nice to find a Quicksilver-only solution, but I have not had any 
luck getting working aliases anywhere within the script (or a few variants).


On Saturday, June 16, 2012 1:43:22 PM UTC-5, Jon Stovell wrote:
>
> Right now your script tells QS to open paths (i.e. strings of text) rather 
> than files or aliases. AppleScript Editor is being a bit forgiving of your 
> error, whereas QS is more strict when it runs a script. Change your script 
> so that all_paths gets populated with aliases instead of paths, and it 
> should work.
>
> On Friday, June 15, 2012 2:42:52 PM UTC-4, Christopher Harwood wrote:
>>
>> I am trying to set up a Quicksilver trigger that brings DEVONthink 
>> records into the first pane in the same way that I can use the Current 
>> Selection proxy object to bring Finder items into that pane.  So far, I 
>> have an Applescript that works when run in the Applescript Editor and also 
>> when run by other programs (specifically, QuicKeys).
>>
>> That's all well and good for my purposes, but I am hoping to find a way 
>> to get Quicksilver to run the script itself.  A trigger set to run the 
>> script appears to do nothing, but perhaps there is some way to see exactly 
>> where it it failing?  Am I missing something obvious, perhaps?  I did not 
>> find any similar issues in the forum, but perhaps I didn't find the right 
>> search terms to use.  So, I'd appreciate any help.
>>
>> The script:
>> -- Getting DEVONthink records into Quicksilver
>> -- Emulates "Select Current Selection in command window" within DT
>>
>> -- Code for getting multiple record selections based on qsGetSel script
>> -- -- by elspub/Elastic Threads at
>> -- -- 
>> https://groups.google.com/d/topic/blacktree-quicksilver/4Qm_esBfye0/discussion
>>
>>
>> tell application "DEVONthink Pro"
>>  -- Get the selection into a variable
>> set the_selection to the selection
>>  -- Count the number of items in the selection
>> set file_count to count of the_selection
>>  -- If the there are more than one items, then
>> -- format the list into something QS recognizes
>> if file_count > 1 then
>> set all_paths to {}
>> repeat with i from 1 to file_count
>> set this_item to item i of the_selection
>> set this_path to get the path of this_item
>> -- set this_alias to this_path as alias
>> set end of all_paths to POSIX path of this_path
>> end repeat
>>  -- If there is only one item, then
>> -- just get the path and QS will know what to do
>> else if file_count = 1 then
>> repeat with this_item in the_selection
>> set all_paths to get the path of this_item
>> end repeat
>>  end if
>> end tell
>>
>> -- Open QS with the formatted path(s)
>> tell application "Quicksilver" to open all_paths
>>
>

-- You received this message because you are subscribed to the Google Groups 
Quicksilver group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send 
email to [email protected]. For more options, 
visit this group at 
https://groups.google.com/d/forum/blacktree-quicksilver?hl=en

Reply via email to