facetheheat reacted to dfay in Ulysses workflow
Well I got a version of ul working last night, but it requires manually loading all the sheet titles and URLs into a list filter. From a CSV that's generated by a workflow in Workflow for iOS. Working as a proof of concept . Since there seems to be no way to get a sheet identifier from the sheet file itself, it seems we would need to use Ulysses get-root-items callback URL, and parse the whole library.
I began to pick apart & try to replicate what the Workflow workflow does (it came from here: https://workflow.is/workflows/84934276b51643678643e1aa326637bd , & I modified it to output title, identifier, [title](ulysses url w/identifier) to a CSV), and convert it to write JSON which can then be read by a Script Filter.
The xcall utility linked above was really helpful at that stage.
Where I ran into trouble (and went to sleep) was at the stage of parsing the JSON.
Here's the code I was running (in CodeRunner -- had to manually authenticate with Ulysses first, too):
#!/usr/bin/python import json import os tmp = os.popen('/Applications/xcall.app/Contents/MacOS/xcall -url "ulysses://x-callback-url/get-root-items?recursive=YES&access-token=your token here"').read() ulyssesLib = json.loads(tmp)['items'] print (ulyssesLib) When I look at that output, it looks to me like it's a (long, messy) list of dictionaries but running type(ulyssesLib) says it's unicode.
facetheheat reacted to robwalton in Ulysses workflow
I've put an Alfred workflow for Ulysses up at packal.org/workflow/ulysses and github. The page includes a download link, full instructions and an image. Please give it a go. The commands are briefly:
u:help -- Show a brief summary of commands Open group or sheet
uf -- Find a group or sheet based on internal content u -- Open group or sheet (cmd-return to drill down) ug -- Open group (cmd-return to drill down) us -- Open sheet Pop open Ulysses Open dialogue
uo -- Search for within Ulysses’ Open dialogue Create sheets
un --Create new sheet with optional text (shift-enter to create in /Inbox) Alfred file actions
Use the Open in Ulysses file action to open text-like files in Ulysses Use the Import into Ulysses file action to create a new sheet from text-like content Configure view to open
u:setsheetview -- Set the view for opening sheets with (defaults to 'Editor Only') u:setgroupview -- Set the view for opening groups with (defaults to 'Sheets') Thanks
deanishe for the awesome Python workflow library dunkaroo for searching and file action help dfay for the new sheet code and file opener and importer katie for thoughts on how find command should work
The source is on github.
facetheheat reacted to facetheheat in SMB/AFP/CIFS shared links converter
I've created a new workflow to help me share smb links.
- convert link like \\server\path to smb://server/path and other unix style,
- convert unix paths to windows style,
- automatically copied all links into clipboard.
Windows user sent me the shared path like:
On my Mac with Alfred, I've convert it in a seconds to unix-style, like: