That is unfortunately a bug in the AppleScript support code, the wrong key was 
used for the file property. This is already fixed for the next release, which 
should come out very soon. You could wait for that, or you may try the 
following workaround. Instead of passing the file in the “with properties” 
argument, you could use the “with data” argument, as in

make new bookmarks thisFolder with data file of theDoc with properties 
{name:”page 42”, page index:42}

Christiaan

> On 31 Oct 2020, at 18:28, Alan Davidson <a...@dsv.su.se> wrote:
> 
> In hopes of making Skim a tailored and powerful tool for my purposes I have 
> started to look at Applescript as a language and as a means to do things with 
> Skim in particular. I am in need of creating large numbers of bookmarks that 
> means that the menu dialogues do not cut it, but my first attempts are not 
> encouraging.
> 
> I have tried:
> 
> tell application "Skim"
>     set theDoc to the front document
>     set thisFolder to make new bookmark with properties {type:folder 
> bookmark, name:"First folder"}
>     make new bookmark at thisFolder with properties {type:file bookmark, 
> file:file of theDoc, name:"page 42", page index:42}
> end tell
> ...but it would seem that I have misunderstood the file property given that 
> whatever I try to provide as argument I get:
> 
> Script Error
> Skim got an error: New file bookmark requires a file.
> I have tried removing the type argument, as in:
> 
> make new bookmark at thisFolder with properties {name:"page 42", page 
> index:42}
> and that seems to create a session bookmark that works, but never with the 
> page index that I give as argument, but only ever with whatever page that 
> happens to be current in the window of the document that I have open. I have 
> never managed to create a bookmark that looks the same as those that are 
> created with the "Add Bookmark" menu choice, either when viewing them in the 
> "Edit Bookmarks..." window or looking at the bookmark plist (with Xcode).
> 
> I am getting the sense that either something is wrong in the Skim dictionary, 
> or something is wrong in my understanding of the dictionary and/or of 
> Applescript. In the hopes that it is the latter - can anyone give me any 
> pointers in how to get this to work?
> 
> Regards,
> Alan
> 
> 
_______________________________________________
Skim-app-users mailing list
Skim-app-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to