This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set theFolder to (path to home folder as text) & "Library:Mobile Documents:iCloud~com~sonnysoftware~bot:Documents" | |
set BEList to {} | |
set orphanList to {} | |
set FinderList to {} | |
set pathList to {} | |
set od to AppleScript's text item delimiters | |
tell application "Finder" | |
-- create a list of the name of every file in the folder you've set | |
set FinderList to every file of folder theFolder as alias list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Bookends" | |
tell front library window | |
set theIDs to get id of publication items of group item "Unlinked Attachments" | |
repeat with theID in theIDs | |
try | |
set myRefs to (publication items whose id is theID) | |
set myItem to first item of myRefs | |
set {theKey, thePath, theAuthor, theEditor, theTitle} to {citekey, path of attachment items, authors, editors, title} of myItem | |
if theAuthor = "" then set theAuthor to theEditor | |
set theRIS to format myItem using "RIS.fmt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Bookends" | |
set theIDs to «event ToySRUID» "Selection" | |
repeat with theID in paragraphs of theIDs | |
tell front library window | |
try | |
set myRefs to (publication items whose id is theID) | |
set myItem to first item of myRefs | |
set thePath to path of attachment items of myItem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set myBibFile to "/Users/zhope/Dropbox/Sundry/Library.bib" | |
if myBibFile exists then | |
set currentBibs to do shell script "/usr/local/bin/pandoc-citeproc --bib2json " & quoted form of myBibFile & " | /usr/local/bin/jq -r ' .[] | \"\\(.id)\"'" | |
set currentBibs to paragraphs of currentBibs | |
end if | |
set bibFile to POSIX file myBibFile | |
my write_to_file("", bibFile, true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set myJSONFile to "/Users/zhope/Dropbox/Sundry/Library.json" | |
set jsonFile to POSIX file myJSONFile | |
tell application "Keyboard Maestro Engine" to set libraryLastUpdate to getvariable "libraryNextUpdate" | |
set lastUpdate to date libraryLastUpdate | |
set theDate to current date | |
set theSeconds to theDate - lastUpdate | |
tell application "System Events" | |
if exists file myJSONFile then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S PATH="${PATH}:/usr/local/bin" PYTHONIOENCODING=UTF-8 LC_ALL=en_US.UTF-8 python | |
# -*- coding: utf-8 -*- | |
then = "20201229160152" | |
import re, shutil, sys | |
import os.path, time | |
from datetime import datetime as dt | |
import json | |
from subprocess import Popen, PIPE |