On 15 Jan 2008, at 5:55 PM, Adam R. Maxwell wrote:
>
> On Tuesday, January 15, 2008, at 08:34AM, "Holger Frauenrath"
> <[EMAIL PROTECTED]> wrote:
>
>> Some background: If I am not mistaken the autofile feature is
>> supposed to help you keep order in your linked files by automatically
>> naming them correctly and putting them in the right place once you
>> associate them (e.g., by drag&drop onto a reference) onto a
>> reference. What this way of linking files and references assumes is
>> that you already have a reference and then, e.g., download a file. I
>> have never used the autofile feature myself for the simple reason
>> that, usually, I work the other way around. I (or one of my
>> coworkers) would typically read some pdf files, and save them to disk
>> if I want to keep them (according to a specified naming scheme, and
>> into a specified literature folder). At a later point, I would search
>> & download the references (e.g., via SciFinder; thanks, Adam!) and
>> import them to BibDesk. So, the pdf files are already in the right
>> place, and they have the right name; what is missing is the
>> association with the references.
>
> If your files are already in the correct location as a matter of
> course, you may want to disable part of AutoFile (uncheck "File
> papers automatically"). Then you can drag-and-drop the PDF onto
> the reference from SciFinder, and you'll have a link to that file
> without moving the file.
>
>> Is there a way to fix the AppleScript?
>
> Yes, but one of the AS gurus will have to help with that...
I'll give some general hints that should be sufficient. First, you
need to get a 'file' object from a path, which you can create from a
path as follows:
set theFile to POSIX file thePath
I'm not sure if it works well with "~", so you may want to use 'POSIX
path of (path to home folder)' and use string concatenation (&) to
build the path.
Next you need to add the file to the linked files. Note that linked
file is an element, not a property (so there can be more than one).
You can add a new linked file as follows (assuming the variable
theFile is a file object):
tell aPublication
make new linked file with data theFile
end tell
Also, you may want to check whether the file exists. One way to do
that is using 'alias' and a 'try' block, as in
try
theFile as alias
set theFileExists to true
on error errorNumber
set theFileExists to false
end try
An alternative is to use Finder:
tell application "Finder"
set theFileExists to (exists theFile)
end tell
HTH,
Christiaan
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users