beet / joplin_alfred_actions

Handy Alfred workflow for interacting with Joplin
12 stars 0 forks source link

Open note with Alfred using applescript works for me #6

Open Marcuzzz opened 1 year ago

Marcuzzz commented 1 year ago

You might find this interesting: https://github.com/Marcuzzz/joplin_alfred_actions

on run argv
 set theQuery to item 1 of argv

 set myDelimiter to "="
 set AppleScript's text item delimiters to myDelimiter

 set myList to every text item of theQuery
 set lastItem to last item of myList

 set AppleScript's text item delimiters to ""

 set newString to text 1 thru -2 of lastItem

 set AppleScript's text item delimiters to ""

    try
        set joplinLink to "joplin://x-callback-url/openNote?id=" & newString

        --display dialog joplinLink

        tell application "Joplin" to activate
        open location joplinLink

    end try
end run
itoldusoandso commented 4 months ago

Is this search or is this open specific note where I know the note name? Or do I need to have the note highlighted in Joplin and then invoke the trigger in Alfred?