Need script to automatically export Skim PDFs with embedded notes
I had the same problem and wanted to batch embed a lot of skim pdfs. The apple script by Jess Riedel wasn't working for me, so I coded a python script to do the job.
I used the script to embed 568 pdfs scattered in a folder with various subfolders. It took 300 seconds. Be aware, that the script won't process files with a &quot; in its filepath.
It is possible to create an osx folder action that runs the script on changed files in a folder automatically, every time a file changes. I haven't developed one yet because I havent found any need for it.
You can download the script as an osx service and as an alfred workflow at https://github.com/alexandergogl/SkimPDF.
# -*- coding: utf-8 -*-

from os import system, walk, path


class SkimPDF(object):
    &quot;&quot;&quot;docstring for SkimPDF.&quot;&quot;&quot;
    def __init__(self):
        self.skimpdf_path = '/Applications/Skim.app/Contents/SharedSupport/skimpdf'
        self.embed_suffix = '_embeded'
        self.replace = False
        pass

    def embed_notes(self, in_pdf):
        &quot;&quot;&quot;Embed skim notes to PDF.&quot;&quot;&quot;
        if self.replace is False:
            out_pdf = &quot;%s%s.pdf&quot; % (in_pdf[:-4], self.embed_suffix)
        else:
            out_pdf = in_pdf

        # Embed notes
        cmd = '%s embed &quot;%s&quot; &quot;%s&quot;' % (self.skimpdf_path, in_pdf, out_pdf)
        result = system(cmd)

        # Compose message
        if result == 0:
            message = &quot;Embeded notes to '%s'&quot; % in_pdf
        else:
            message = result

        return message

    def embed_notes_batch(self, folder):
        &quot;&quot;&quot;Loop through directories in given folder and embed notes.&quot;&quot;&quot;
        messages = []
        i = 0
        for path, subdirs, files in walk(folder):
            for name in files:
                if name.endswith(&quot;.pdf&quot;):
                    i += 1
                    # embed notes to pdf
                    pdf_file = &quot;%s/%s&quot; % (path, name)
                    result = skim.embed_notes(pdf_file)
                    # add result message to report
                    messages.append(result)
                    # report current state
                    print(i)

        self.report(messages)
        pass

    def report(self, messages):
        &quot;&quot;&quot;Print list of processed pdfs.&quot;&quot;&quot;
        print(&quot;\n\nProcessing PDFs done:&quot;)

        for i in range(len(messages)):
            message = &quot;%s: %s&quot; % (i + 1, messages[i])
            print(message)
        pass


skim = SkimPDF()
skim.replace = True  # set to false if you want a copy in place instead
# skim.embed_suffix = '_embeded'  # uncomment and enter your own suffix if necessary

# embed notes of a single pdf
skim.embed_notes('../path/to/pdf file.pdf')

# batch embeding process with path to folder with literature
skim.embed_notes_batch('../path/to/Literature folder')