Menu

#1487 Annoying warning with "auto file" Applescript command

unverified
closed-invalid
nobody
None
5
2016-02-22
2016-02-21
No

I keep all my Bibdesk file and attahmenta files on Dropbox. I wrote a series of Applescript for my doscuments annotation workflow which makes extensive use of the "auto file" Bibdesk Applecript function. Everything worked beutifully for almost 2 years.

I recently linked a businessa Dropbox account to my computer my "~/Dropbox/" is now automatically renamed to "~/Dropbox (Personal)/". When now I link a new file wilt the "auto file" command I get a working dialog box as attached. Nevertheless, the file get linked correctly in side Bibdesk, i.e. with the correct path:"~/Dropbox (Personal)/"

I carefully debugged the scripts and isolated the source of the worning to the "auto file" command.

1 Attachments

Discussion

  • Christiaan Hofman

    It looks like you try to auto file the Dropbox folder here. Are you sure you are trying to auto file the correct file, and what format are you using?

     
  • Alessandro Piovaccari

    No, I am pretty sure I am auto filing the file. Below is the code. Also, the file get autofiled correctly. The file is of type .md (markdown) I have the same problem with .docx and .skim files. The script runs under skim.

    tell application "Skim"
        activate
        set filepathSh to path of document 1 -- This is a PDF document
    end tell
    set filepath to POSIX file filepathSh
    set filepathMd to Unicode text 1 thru -5 of (filepath as Unicode text) & ".md"
    <here there is code to save PDF annotations in a .md file with same path and name of .pdf>
    tell document 1 of application "BibDesk"
    activate
    <here some coed to find the publication index>
    set theIndex to <...>
    make new linked file with data filepathMd
    auto file at index theIndex
    end tell
    

    If you want I can email you the full script.

     

    Last edit: Alessandro Piovaccari 2016-02-22
    • Christiaan Hofman

      This doesn't look right, yuou should auto file a publication, not a document. The index is the index of the file, not the publication.

       
  • Christiaan Hofman

    I really need a cleaner report. All I can see from the scxreenshot is that you try to auto file the folder ~/Dropbox. So this must be going on somewhere in the script.

    The problem ius that you talks about a complex script that does a lot of things, mostr are irrelevant to the problem. So try to isolate the real problem. And try to reduce it to a simple reproducable (for me!) problem, using a simple script, or even better just a menu action. If it is a problem with auto file (which I still doubt) hen you can reproduce it with a simple auto file. Otherwise, it really is a problem with your script or your setup.

     
  • Alessandro Piovaccari

    I understand. My code comment was wrong. I meant the index of the file in the publication. This is how "theIndex" is determined

    set theIndex to count of (get linked files)
    set theIndex to (theIndex + 1) -- to be sure we do not autofile on top of the PDF
    auto file at index theIndex
    

    Moreover, the file get linked correctly. So the scripts works correctly.

     
  • Alessandro Piovaccari

    Christiaan, I think you were correct on your first statement. The "make new linked file" does the job. The the index increment brings to an unexistent file and "auto file" try to link an empty path. More over the "auto file" command is not necessary. Sorry for wasting your time. Not sure why before it did not used to generate the warning though... Thanks!

     
  • Christiaan Hofman

    • status: open --> closed-invalid
     

Log in to post a comment.