Select Library in capture script

Most of the time, the default capture script works just fine for me. But sometimes (particularly in my news reader), it would be handy to define which library to import to.

I tried to do this by customizing the capture script. Listing and selecting the desired library is easy, but I’m having trouble getting the capture to work correctly.

I can make the desired library frontmost by doing:


tell application "EagleFiler"
    open (file of the_library) as alias
end tell

But the import still goes to whatever library was frontmost when the capture key was invoked.

Alternatively, I can bypass the normal capture with an import command:


tell application "EagleFiler"
    tell the_library
        import URLs {theURL}
    end tell
end tell
return {}

This does the import correctly, but also makes EF activate and display an error message

Is there a way around this?

Yes, I am working on a way for you to choose the library when you press the capture key. I don’t think there’s a way for you to address this yourself by modifying the capture script. (In general, and especially for forward compatibility, capture scripts should not modify the library; they should only return the requested information to the caller of the capture() handler.) You could, however, write your own script that uses the import command directly and assign it a keyboard shortcut using FastScripts.

That would be great.

So be it. Thought it was worth a try, though.

I figured as much. Only tried it when the other way didn’t work.

Clearly the next step. I was just hoping to work within the existing triggering mechanism.

Thanks.

Starting with EagleFiler 1.3, you can press Option-F1 to choose the library when capturing.