vault backup: 2025-08-08 17:26:16
This commit is contained in:
1 parent
ba2fe2b6a9
commit
992b362ffd
83 files changed
+20118
-45907
No files matched your search
+122
-122
@@ -28,29 +28,29 @@ var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
|
||||
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
||||
var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1);
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
function __awaiter(thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
function __awaiter(thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
}
|
||||
|
||||
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
||||
@@ -2320,27 +2320,27 @@ async function runAppleScriptAsync(script) {
|
||||
return stdout;
|
||||
}
|
||||
|
||||
obsidian.addIcon('DEVONthink-logo-neutral', `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 75 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||||
<g transform="matrix(1,0,0,1,-24,-28)">
|
||||
<g>
|
||||
<path d="M49.214,61.093L27.76,73.903C27.76,73.903 33.326,94.068 60.807,94.212C84.019,94.333 94.959,74.348 95.626,63.402C96.311,52.176 90.679,31.855 69.477,31.855C43.67,31.855 47.178,59.386 49.214,61.093Z" style="fill:none;stroke:currentColor;stroke-width:6px;"/>
|
||||
<path d="M65.37,59.193C56.43,57.776 60.045,46.29 67.466,46.434C72.172,46.525 77.034,49.196 77.319,57.169C77.529,63.05 73.829,69.654 63.674,69.882C53.519,70.11 49.214,61.093 49.214,61.093C49.214,61.093 55.701,71.918 47.914,78.584C38.756,86.423 27.922,73.893 27.922,73.893" style="fill:none;stroke:currentColor;stroke-width:6px;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
obsidian.addIcon('DEVONthink-logo-neutral', `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 75 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||||
<g transform="matrix(1,0,0,1,-24,-28)">
|
||||
<g>
|
||||
<path d="M49.214,61.093L27.76,73.903C27.76,73.903 33.326,94.068 60.807,94.212C84.019,94.333 94.959,74.348 95.626,63.402C96.311,52.176 90.679,31.855 69.477,31.855C43.67,31.855 47.178,59.386 49.214,61.093Z" style="fill:none;stroke:currentColor;stroke-width:6px;"/>
|
||||
<path d="M65.37,59.193C56.43,57.776 60.045,46.29 67.466,46.434C72.172,46.525 77.034,49.196 77.319,57.169C77.529,63.05 73.829,69.654 63.674,69.882C53.519,70.11 49.214,61.093 49.214,61.093C49.214,61.093 55.701,71.918 47.914,78.584C38.756,86.423 27.922,73.893 27.922,73.893" style="fill:none;stroke:currentColor;stroke-width:6px;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
`);
|
||||
obsidian.addIcon('DEVONthink-logo-blue', `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 75 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||||
<g transform="matrix(1,0,0,1,-24,-28)">
|
||||
<g>
|
||||
<path d="M49.214,61.093L27.76,73.903C27.76,73.903 33.326,94.068 60.807,94.212C84.019,94.333 94.959,74.348 95.626,63.402C96.311,52.176 90.679,31.855 69.477,31.855C43.67,31.855 47.178,59.386 49.214,61.093Z" style="fill:none;stroke:#36C6EE;stroke-width:6px;"/>
|
||||
<path d="M65.37,59.193C56.43,57.776 60.045,46.29 67.466,46.434C72.172,46.525 77.034,49.196 77.319,57.169C77.529,63.05 73.829,69.654 63.674,69.882C53.519,70.11 49.214,61.093 49.214,61.093C49.214,61.093 55.701,71.918 47.914,78.584C38.756,86.423 27.922,73.893 27.922,73.893" style="fill:none;stroke:#36C6EE;stroke-width:6px;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
obsidian.addIcon('DEVONthink-logo-blue', `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 75 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||||
<g transform="matrix(1,0,0,1,-24,-28)">
|
||||
<g>
|
||||
<path d="M49.214,61.093L27.76,73.903C27.76,73.903 33.326,94.068 60.807,94.212C84.019,94.333 94.959,74.348 95.626,63.402C96.311,52.176 90.679,31.855 69.477,31.855C43.67,31.855 47.178,59.386 49.214,61.093Z" style="fill:none;stroke:#36C6EE;stroke-width:6px;"/>
|
||||
<path d="M65.37,59.193C56.43,57.776 60.045,46.29 67.466,46.434C72.172,46.525 77.034,49.196 77.319,57.169C77.529,63.05 73.829,69.654 63.674,69.882C53.519,70.11 49.214,61.093 49.214,61.093C49.214,61.093 55.701,71.918 47.914,78.584C38.756,86.423 27.922,73.893 27.922,73.893" style="fill:none;stroke:#36C6EE;stroke-width:6px;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
`);
|
||||
const DEFAULT_SETTINGS = {
|
||||
ribbonButtonAction: 'open',
|
||||
@@ -2431,53 +2431,53 @@ class DEVONlinkPlugin extends obsidian.Plugin {
|
||||
let currentLinkType = this.settings.linkTypeSetting;
|
||||
let wikiLinkLine = `"${relatedItemsPrefix}" & "[[" & name of eachRecord & "]]" & return`;
|
||||
let DEVONthinkLinkLine = `"${relatedItemsPrefix}" & "[" & name of eachRecord & "](" & reference URL of eachRecord & ")" & return`;
|
||||
let appleScript = `tell application id "DNtp"
|
||||
if not running then
|
||||
run
|
||||
end if
|
||||
try
|
||||
set theDatabases to databases
|
||||
repeat with thisDatabase in theDatabases
|
||||
set theNoteRecords to (lookup records with file "${noteFilename}" in thisDatabase)
|
||||
if theNoteRecords is not {} then
|
||||
set theNoteRecord to the first item in theNoteRecords
|
||||
try
|
||||
set seeAlso to compare record theNoteRecord to theNoteRecord's database
|
||||
set listOfRecords to ""
|
||||
set maximumItems to ${maximumRelatedItemsSetting}
|
||||
set itemCount to 0
|
||||
repeat with eachRecord in seeAlso
|
||||
if itemCount is not 0 then
|
||||
if itemCount is greater than maximumItems then
|
||||
return listOfRecords
|
||||
else
|
||||
if ("${currentLinkType}" is equal to "intelligentLinking") then
|
||||
if eachRecord's type is markdown then
|
||||
if eachRecord's path contains "${vaultName}" then
|
||||
set listOfRecords to listOfRecords & ${wikiLinkLine}
|
||||
else
|
||||
set listOfRecords to listOfRecords & ${DEVONthinkLinkLine}
|
||||
end if
|
||||
else
|
||||
set listOfRecords to listOfRecords & ${DEVONthinkLinkLine}
|
||||
end if
|
||||
else if ("${currentLinkType}" is equal to "wikiLinks") then
|
||||
set listOfRecords to listOfRecords & ${wikiLinkLine}
|
||||
else if ("${currentLinkType}" is equal to "devonthinkURL") then
|
||||
set listOfRecords to listOfRecords & ${DEVONthinkLinkLine}
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
set itemCount to itemCount + 1
|
||||
end repeat
|
||||
return listOfRecords
|
||||
on error
|
||||
return "failure"
|
||||
end try
|
||||
end if
|
||||
end repeat
|
||||
return "failure"
|
||||
end try
|
||||
let appleScript = `tell application id "DNtp"
|
||||
if not running then
|
||||
run
|
||||
end if
|
||||
try
|
||||
set theDatabases to databases
|
||||
repeat with thisDatabase in theDatabases
|
||||
set theNoteRecords to (lookup records with file "${noteFilename}" in thisDatabase)
|
||||
if theNoteRecords is not {} then
|
||||
set theNoteRecord to the first item in theNoteRecords
|
||||
try
|
||||
set seeAlso to compare record theNoteRecord to theNoteRecord's database
|
||||
set listOfRecords to ""
|
||||
set maximumItems to ${maximumRelatedItemsSetting}
|
||||
set itemCount to 0
|
||||
repeat with eachRecord in seeAlso
|
||||
if itemCount is not 0 then
|
||||
if itemCount is greater than maximumItems then
|
||||
return listOfRecords
|
||||
else
|
||||
if ("${currentLinkType}" is equal to "intelligentLinking") then
|
||||
if eachRecord's type is markdown then
|
||||
if eachRecord's path contains "${vaultName}" then
|
||||
set listOfRecords to listOfRecords & ${wikiLinkLine}
|
||||
else
|
||||
set listOfRecords to listOfRecords & ${DEVONthinkLinkLine}
|
||||
end if
|
||||
else
|
||||
set listOfRecords to listOfRecords & ${DEVONthinkLinkLine}
|
||||
end if
|
||||
else if ("${currentLinkType}" is equal to "wikiLinks") then
|
||||
set listOfRecords to listOfRecords & ${wikiLinkLine}
|
||||
else if ("${currentLinkType}" is equal to "devonthinkURL") then
|
||||
set listOfRecords to listOfRecords & ${DEVONthinkLinkLine}
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
set itemCount to itemCount + 1
|
||||
end repeat
|
||||
return listOfRecords
|
||||
on error
|
||||
return "failure"
|
||||
end try
|
||||
end if
|
||||
end repeat
|
||||
return "failure"
|
||||
end try
|
||||
end tell`;
|
||||
let DEVONlinkResults = yield runAppleScriptAsync(appleScript);
|
||||
if (DEVONlinkResults == "failure") {
|
||||
@@ -2511,21 +2511,21 @@ class DEVONlinkPlugin extends obsidian.Plugin {
|
||||
// let vaultPath = vaultAdapter.getBasePath(); // No longer needed, but leaving it in in case I ever decide to return to try to figure out how to get the path right. It would be a more robust solution than relying on filenames.
|
||||
// let homeFolderPath = await runAppleScriptAsync('get POSIX path of the (path to home folder)'); // see above
|
||||
// attempting to get path to work: await runAppleScriptAsync('tell application id "DNtp" to open window for record (first item in (lookup records with path "~' + vaultPath + '/' + notePath + '") in database (get database with uuid "'+ this.settings.databaseUUID + '")) with force'); // see above
|
||||
let DEVONlinkResults = yield runAppleScriptAsync(`tell application id "DNtp"
|
||||
activate
|
||||
try
|
||||
set theDatabases to databases
|
||||
repeat with thisDatabase in theDatabases
|
||||
try
|
||||
set theNoteRecord to (first item in (lookup records with file "${noteFilename}" in thisDatabase))
|
||||
set newDEVONthinkWindow to open window for record theNoteRecord with force
|
||||
activate
|
||||
return "success"
|
||||
end try
|
||||
end repeat
|
||||
on error
|
||||
return "failure"
|
||||
end try
|
||||
let DEVONlinkResults = yield runAppleScriptAsync(`tell application id "DNtp"
|
||||
activate
|
||||
try
|
||||
set theDatabases to databases
|
||||
repeat with thisDatabase in theDatabases
|
||||
try
|
||||
set theNoteRecord to (first item in (lookup records with file "${noteFilename}" in thisDatabase))
|
||||
set newDEVONthinkWindow to open window for record theNoteRecord with force
|
||||
activate
|
||||
return "success"
|
||||
end try
|
||||
end repeat
|
||||
on error
|
||||
return "failure"
|
||||
end try
|
||||
end tell`);
|
||||
if (DEVONlinkResults != "success") {
|
||||
new obsidian.Notice("Sorry, DEVONlink couldn't find a matching record in your DEVONthink databases. Make sure your notes are indexed, the index is up to date, and the DEVONthink database with the indexed notes is open.");
|
||||
@@ -2552,23 +2552,23 @@ class DEVONlinkPlugin extends obsidian.Plugin {
|
||||
// let vaultPath = vaultAdapter.getBasePath(); // No longer needed, but leaving it in in case I ever decide to return to try to figure out how to get the path right. It would be a more robust solution than relying on filenames.
|
||||
// let homeFolderPath = await runAppleScriptAsync('get POSIX path of the (path to home folder)'); // see above
|
||||
// attempting to get path to work: await runAppleScriptAsync('tell application id "DNtp" to open window for record (first item in (lookup records with path "~' + vaultPath + '/' + notePath + '") in database (get database with uuid "'+ this.settings.databaseUUID + '")) with force'); // see above
|
||||
let DEVONlinkResults = yield runAppleScriptAsync(`tell application id "DNtp"
|
||||
activate
|
||||
try
|
||||
set theDatabases to databases
|
||||
repeat with thisDatabase in theDatabases
|
||||
try
|
||||
set theNoteRecord to (first item in (lookup records with file "${noteFilename}" in thisDatabase))
|
||||
set theParentRecord to the first parent of theNoteRecord
|
||||
set newDEVONthinkWindow to open window for record theParentRecord with force
|
||||
set newDEVONthinkWindow's selection to theNoteRecord as list
|
||||
activate
|
||||
return "success"
|
||||
end try
|
||||
end repeat
|
||||
on error
|
||||
return "failure"
|
||||
end try
|
||||
let DEVONlinkResults = yield runAppleScriptAsync(`tell application id "DNtp"
|
||||
activate
|
||||
try
|
||||
set theDatabases to databases
|
||||
repeat with thisDatabase in theDatabases
|
||||
try
|
||||
set theNoteRecord to (first item in (lookup records with file "${noteFilename}" in thisDatabase))
|
||||
set theParentRecord to the first parent of theNoteRecord
|
||||
set newDEVONthinkWindow to open window for record theParentRecord with force
|
||||
set newDEVONthinkWindow's selection to theNoteRecord as list
|
||||
activate
|
||||
return "success"
|
||||
end try
|
||||
end repeat
|
||||
on error
|
||||
return "failure"
|
||||
end try
|
||||
end tell`);
|
||||
if (DEVONlinkResults != "success") {
|
||||
new obsidian.Notice("Sorry, DEVONlink couldn't find a matching record in your DEVONthink databases. Make sure your notes are indexed, the index is up to date, and the DEVONthink database with the indexed notes is open.");
|
||||
|
||||
Reference in new issue
Block a user