Here’s a bash script that does what you want:

#!/bin/bash
file=“$1"
[[ $# -gt 2 ]] && outfile=“$2" || outfile=“${file%.pdf}.fdf"

[[ "${file:0:1}" == "/" ]] || file="${PWD}/${file}"
[[ “${outfile:0:1}" == "/" ]] || file="${PWD}/${outfile}"

/usr/bin/osascript << EOF
  set theFile to POSIX file "${file}"
  set thePath to POSIX path of (theFile as alias)
  set theOutFile to POSIX file “${outfile}"
  tell application "Skim"
    open theFile
    set theDocs to get documents whose path is thePath
    if (count of theDocs) = 0 then set theDocs to {document 1}
    set theDoc to contents of item 1 of theDocs
    save theDoc in theOutFile as “Notes as FDF"
  end tell
EOF


> On 27 Dec 2024, at 00:20, Dan Hicks <hicks.danie...@gmail.com> wrote:
> 
> Hmm okay.  I haven’t done anything with Applescript in … 15 years?  
> 
> If anyone can throw together a MWE in Applescript I’d be most grateful!  
> Otherwise, let’s see what ChatGPT can put together.  
> 
> Thanks! 
> -----
> Dan Hicks
> Associate Professor and Chair
> Department of Philosophy
> University of California, Merced
> 
> Pronouns: they/them/their
> 
>> On Dec 26, 2024, at 3:18 PM, Christiaan Hofman <cmhof...@gmail.com> wrote:
>> 
>> The skimnotes tool cannot do that.
>> 
>> You could use AppleScript for that though.
>> 
>> Christiaan
>> 
>>> On 27 Dec 2024, at 00:14, Dan Hicks <hicks.danie...@gmail.com 
>>> <mailto:hicks.danie...@gmail.com>> wrote:
>>> 
>>> Using skimnotes, how do I replicate the functionality of File -> Export -> 
>>> Notes as FDF? The -format values `archive`, `plist`, and `fdf` (not listed, 
>>> but tried just in case) all generate a plist file, which doesn’t seem to be 
>>> what Acrobat expects. 
>>> 
>>> Thanks, and be well, 
>>> Dan Hicks
>>> -----
>>> Dan Hicks
>>> Associate Professor and Chair
>>> Department of Philosophy
>>> University of California, Merced
>>> 
>>> Pronouns: they/them/their
>> _______________________________________________
>> Skim-app-users mailing list
>> Skim-app-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/skim-app-users
> 
> _______________________________________________
> Skim-app-users mailing list
> Skim-app-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/skim-app-users

Christiaan

_______________________________________________
Skim-app-users mailing list
Skim-app-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to