Skip to content

Commit

Permalink
chore(app.js): remove unused child_process import to improve code cle…
Browse files Browse the repository at this point in the history
…anliness

chore(app.js): remove commented out process.exit(0) to improve code readability
chore(info.plist): update shell script command to execute joplinsearch instead of app.js to reflect changes in package.json
chore(info.plist): update ypos value to 340 to improve alignment of Alfred Actions window
chore(joplinsearch): add joplinsearch script to the project
chore(package.json): add joplinsearch as a dependency and update main script to app.js
chore(package.json): add outputPath and scripts for packaging the app for macOS
chore(readme.md): update title to "Joplin Alfred Actions" to reflect the purpose of the project
  • Loading branch information
Marc Otten committed Aug 13, 2023
1 parent 97c1474 commit ccf1f7c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const request = require('request');
const { exec } = require('child_process');
require('dotenv').config();

const API_TOKEN = process.env.joplin_key;
Expand Down Expand Up @@ -38,6 +37,8 @@ searchNotes()
icon: {path: "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertCautionIcon.icns"}
}))}));

//process.exit(0)

})
.catch((err) => {
console.error('Error:', err.message);
Expand Down
17 changes: 13 additions & 4 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
set jsonOutput to "{\"items\": [{\"title\": \"No notes found\", \"subtitle\": \"Try a different query?\", \"valid\": false, \"icon\": {\"path\": \"/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertCautionIcon.icns\"}}]}"
return jsonOutput
else
set jsonOutput to do shell script "node app.js " & quoted form of query
set jsonOutput to do shell script "./joplinsearch " & quoted form of query
return jsonOutput
end if
Expand Down Expand Up @@ -177,7 +177,15 @@ end run</string>
set AppleScript's text item delimiters to ""
try set joplinLink to "joplin://x-callback-url/openNote?id=" &amp; newString --display dialog joplinLink tell application "Joplin" to activate open location joplinLink end try
try
set joplinLink to "joplin://x-callback-url/openNote?id=" &amp; newString
--display dialog joplinLink
tell application "Joplin" to activate
open location joplinLink
end try
end run</string>
<key>scriptargtype</key>
<integer>1</integer>
Expand All @@ -195,15 +203,16 @@ end run</string>
</dict>
</array>
<key>readme</key>
<string></string>
<string># Joplin Alfred Actions
</string>
<key>uidata</key>
<dict>
<key>00E278B7-8E47-428C-B13E-3EAA77C20C4F</key>
<dict>
<key>xpos</key>
<real>180</real>
<key>ypos</key>
<real>345</real>
<real>340</real>
</dict>
<key>1BE4897D-FD74-4E22-9992-A9641ED0E0C2</key>
<dict>
Expand Down
Binary file added joplinsearch
Binary file not shown.
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"name": "joplinsearch",
"version": "1.0.0",
"productName": "joplinsearch",
"license": "ISC",
"author": "Marc Otten",
"main": "./app.js",
"dependencies": {
"dotenv": "^16.3.1",
"open": "^9.1.0",
"request": "^2.88.2"
},
"outputPath": "release-builds/largtype-darwin-x64/",
"scripts": {
"package-mac": "nexe --build app.js -o joplinsearch"
}
}
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# My Awesome project
![ Alt text]('')
# Joplin Alfred Actions

0 comments on commit ccf1f7c

Please sign in to comment.