Jump to content

Christin White

Member
  • Posts

    16
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Christin White reacted to andreas.w in Search and add bookmarks to Raindrop.io   
    Just released version 2.0!
     
    This is something that I realized maybe a year ago that I wanted to do eventually, to rewrite all the PHP and Python (which is almost all of what this workflow used to be) in a way that will make it work without external dependencies when Apple stops providing PHP and Python with the OS (which has been know for a while that they will eventually stop doing)
     
    With macOS 12 Monterey, which will be released possibly as soon as the coming week (but more likely next month), PHP will be gone, which means that this workflow would not function if you did not manually install PHP yourself, and while I did some changes in version 1.7 recently to make the workflow function with a version of PHP that you have installed yourself, I do really not like the idea of requiring PHP to be manually installed for my workflow to function, and it is also just a matter of time before Python goes away as well. Likely next year.
     
    So I have rewritten everything that was written in PHP and Python in Go instead. Which means that almost everything is entirely rewritten (there is just a bit of AppleScript that has only changed a little)
     
    Go is a compiled programming language, and it does not require any runtime to be installed to function once the code is compiled. This means that the workflow is not dependent on Apple to provide support for something like PHP or Python in macOS anymore, and Go also has the added benefit of being faster than a scripting language like PHP.
     
    Version 2.0 does not really look or behave as different as the version bump might indicate, but almost everything has changed underneath to make this a better workflow.
    Rewritten in Go, so no dependency on PHP or Python anymore. This is important, as Apple is removing PHP from macOS 12 Monterey, and will also remove Python from macOS in the future. It's faster! Running the backend of the workflow as a compiled binary (Go) instead of a script (PHP) makes it faster, and it is also compiled as a universal binary, so it's running natively on both Apple Silicon and Intel Macs, but there are also some other changes that helps to make it faster and you will probably notice the difference if you used the old version before. Less risk for unexpected behavior that leads to bugs, both because it can't behave different depending on which PHP or Python version you have anymore, but also because it now for example uses more reliable ways to keep track of information while navigating through the different parts of the workflow. Adding bookmarks from Firefox is now more reliable, and if things still occasionally go wrong, the workflow is better at communication that in a useful way. (I switched from Safari to Firefox myself, so it got some more attention than before) Ability to add a bookmark by copying the address, rather than getting it from the currently active browser window. To use this feature for adding a bookmark from an unsupported browser (or somewhere else), just copy the address and go to the bookmark adding feature of this workflow. It will just work, without you having to do anything more than that! Get it from GitHub!
  2. Like
    Christin White got a reaction from deanishe in A couple of basic questions   
    Oh, duh, I'm pointing it at at the drive root that way, it's been a really long week ?
  3. Thanks
    Christin White got a reaction from deanishe in A couple of basic questions   
    Wow, thank you so much deanishe, your answers and pull request were immensely helpful!
     
    Regarding 1, that makes sense about variables, while I'm okay at bash scripting I'm still figuring out what information AppleScript has and what it doesn't, I figured it wasn't a full shell but didn't know if it could access some of the same information, thank you for clarifying! I agree that the Run NSAppleScript object wasn't ideal, it's where I started before switching to the Script Filter, learning a lot more and hadn't gotten back to reworking the action itself, I'm glad it looks like I would have been on the right track!
     
    Regarding items in the workflow directory, I had tried to call them using a relevant path but had missed the leading `.`, that's much easier to work with! I didn't plan to leave the code in there to allow it to be run anywhere, just did to for convenience as I was working on it but with a working relative path even that's unnecessary.
     
    I hadn't thought of using a symlink, that's brilliant!
     
    Thanks for the info on resolution, I'll try 256px and see how they look on an iPad.
     
    Regarding the last item, I had tried chaining a Keyword as input to the Script Filter like you reworked it but while it will execute the downstream action it won't trigger the Script Filter's functionality to run so I get the placeholder result rather than actual results, it sounds like I should just use duplicate script filters and running a script file limits the repeat for the most part, just hoped there might be a better approach. 
     
    @Andrew if you don't mind a feature request it would be wonderful if you could set multiple keywords throughout Alfred, something like `love|itunes`, I definitely would use them for workflows and web searches so I could assign general keywords that I can arrow/number select from when I'm blanking on a specific keyword. Here's an example of where I've chosen general over specific:
     

  4. Like
    Christin White reacted to deanishe in A couple of basic questions   
    Regarding 1: You can't read workflow variables in an editor. They're environmental variables that only exist within Alfred, so to read them, you must run your script from Alfred (or a shell with the same variables exported). You use set myVar to (system attribute "variable_name"), as described in the sticky, but as the variable only exists within Alfred, that isn't going to work in Script Editor.
     
    Instead of copying-and-pasting your script into Alfred (and you shouldn't use Run NSAppleScript in any case), save the script file in the workflow, and call it via a Run Script as you're doing with the Script Filter script.
     
    Regarding 2: Leave icons in the workflow folder. They're part of the workflow, not data, so they belong in the workflow folder.
     
    There isn't an exported variable for the workflow folder because that's the working directory when your workflow is run, i.e. the workflow folder is always ./. You don't need to faff about with workflowPath in your script. Just use ./icons/notplaying.png etc.
     
    I'd say it's generally not worth the effort trying to make your workflow scripts runnable from anywhere. As soon as you start using workflow variables or adding control flow to the workflow in Alfred's workflow editor, it becomes largely pointless to run the scripts from anywhere else. cd to the workflow's directory in your shell, and do your command-line stuff from there.
     
    Regarding 3: You can only set icons programatically in Script Filter output. Your best bet is to make the duplicates symlinks to the original.
     
    Regarding 4: No SVG. You can use ICNS files, though. I usually use 256px icons. But I'm not a good icon guy.
     
    Regarding 5: You can't easily assign two keywords to a single Script Filter (you have to duplicate the filter). But you can connect multiple Keyword Inputs to one Script Filter.  Where you seem to be going wrong is with the Args & Vars Utility. The Script Filter's keyword is for calling it directly from Alfred's query box. You don' t use it in the workflow: the connection is enough to run the Script Filter. What you're actually doing is passing the query "love" (which is perhaps intended?) to your Script Filter, but it isn't configured to accept a query…
     
    This is all a bit complicated to explain in text, so I've submitted a PR with some fixes.
  5. Like
    Christin White reacted to deanishe in A couple of basic questions   
    Also, if you do start using workflow variables set in the configuration sheet, here's a handy script to extract them from info.plist and export them in your shell.
  6. Like
    Christin White reacted to vitor in Workflow Cache Dir, how and/or who has to create the Dir   
    [[ -d "${alfred_workflow_data}" ]] || mkdir "${alfred_workflow_data}"
    On my machine that takes (according to time) 1 millisecond after the directory exists (3 to create it). I’m not even sure it takes the full millisecond (can time display lower?). It’s also a single clear line.
     
     
    I do not want a barrage of empty directories. I like to know when a workflow needs those directories or not. Not having a bunch of them also helps when diagnosing workflow problems or migrating them from one Alfred version to the next (like I did with some workflows I used that were abandoned in version 2).

    In addition, there’s no scenario where Alfred could just create the directories once you open the workflows, because there’s always the possibility the user (or something on their machine) would delete them, meaning Alfred itself would need to always do that check. It might save a single line in your code, but it won’t save in execution time. In fact, it would mean that now every workflow that does not need those directories would also be constantly checking for those directories, which is even more wasteful.

    Best we could expect here would be a toggle in the workflow creation sheet to tell if Alfred should create the directories or not, on a workflow-by-workflow basis. Not sure that is even worth it, but it wouldn’t be harmful either (although it might be confusing to some users).
  7. Like
    Christin White reacted to deanishe in Script Filter JSON Format   
    Really, you should be using a proper JSON library. But "manually" generating it is fine for simple cases.
     
    What you want to do here is create a list of your lines of JSON, and when you're done, join them:
    on joinWithCommas(theList) set oldDelims to AppleScript's text item delimiters set AppleScript's text item delimiters to "," set theString to theList as string set AppleScript's text item delimiters to oldDelims return theString end joinWithCommas set theItems to {"first string", "second string"} set theJSON to my joinWithCommas(theItems)  
  8. Like
    Christin White reacted to vitor in Workflow libraries and helpers   
    Libraries and Frameworks

    Python 3: Alfred-Workflow, by Adam Hitchcock
    Python 3: Ualfred, by @chaojie
    Dart: Alfred Workflow, by Klemen Tusar
    Go: go-alfred by Jason Cheatham
    PHP: Alfred Workflows PHP Helper by @joetannenbaum
    Node.js: Alfy, by @sindresorhus

    Other Utilities

    Add auto-updating to your Workflow: OneUpdater, by @vitor
    iTerm2 intergration: Custom Alfred iTerm Scripts, by @vitor
     

    All the libraries on this list are (at the time of the last edit) up-to-date and their developers are either still supporting them or forum regulars. That means any problems you find and suggestions you have are likely to be addressed.

    If there’s any library you think belongs in (or should be removed from) this list, leave a reply below. I’ll evaluate it and then hide the comments (so the thread can be kept tidy).
     
  9. Like
    Christin White reacted to shazoom in Find workflow folder with applescript   
    You can runs a shell script to do it. To load an external Applescript library, for example,:
    global bt_lib set bt_lib_filename to "bt_lib.scpt" set pwd to (do shell script "pwd") set bt_lib to load script (pwd & "/" & bt_lib_filename) I got this from: https://github.com/qlassiqa/qworkflow
  10. Like
    Christin White reacted to GuiB in Change default Terminal to Hyper.is ?   
    Here is an updated version
     
    I wanted to test to find a way so the script wait that the application is ready instead of a definite time before sending the keystrokes. With this version it should be faster and less error prone. Best!
     
    on alfred_script(q) if (text 1 thru 2 of q) is equal to "cd" then do shell script "open -a Hyper " & text 4 thru -1 of q else do shell script "open -a Hyper ~" set appOpen to false set nbrOfTry to 0 delay 0.5 repeat try tell application "System Events" if exists (window 1 of process "Hyper") then set appOpen to true exit repeat end if end tell end try set nbrOfTry to nbrOfTry + 1 if nbrOfTry = 20 then exit repeat delay 0.5 end repeat if appOpen then tell application "System Events" to keystroke q & return end if end alfred_script  
  11. Like
    Christin White reacted to andrewbkil in Kaleidoscope Text   
    Basic Kaleidoscope & Alfred Integration
    open up Kaleidoscope straight from you clipboard
     
    *Required Setting*
    -Alfred Powerpack
    -Kaleidoscope
    -Alfred Clipboard Hotkey set to cmd+alt+c

    *Keywords*
    ks           Opens KS
    ksn          Opens new KS for copied text
    ksd          Opens KS for copied text
    *Hotkeys*
    cmd+alt+k    Opens new KS for copied text
    cmd+k        Opens KS for copied text
    https://github.com/andrewbkil/AlfredWorkflowKSdiff
     
  12. Like
    Christin White reacted to dvcrn in Alfred -> DEVONthink   
    The theme in the screenshot is The Minimalist. I use the 'almost midnight' variant
  13. Like
    Christin White reacted to joeynotjoe in Integrate iTerm with Alfred   
    I would love an integration with Hyper, too! 
  14. Like
    Christin White reacted to seanboramlee in Integrate iTerm with Alfred   
    Hi Stuart,
     
    Any chance you could provide some guidance on writing an integration for Hyper? 
     
    Thanks!
    Sean
  15. Like
    Christin White got a reaction from xilopaint in Things for Alfred – Interact with Things 3 using Alfred   
    This is exceptional @xilopaint, thank you for building it!
  16. Like
    Christin White reacted to xilopaint in Things for Alfred – Interact with Things 3 using Alfred   
    Things for Alfred

    Interact with Things 3 using Alfred.

    Download and Installation
    Download the workflow file from GitHub releases and install it by double-clicking on Things.alfredworklow.

    Usage
    Use the keyword todo to show Things lists and action any of them for displaying the corresponding to-dos. Action a to-do to display it in the Things UI. Try the modifier keys either in lists or in to-dos to know other actions. Contribute
    To report a bug or request a feature, please create an issue or submit a pull request on GitHub.

    Credits
    This workflow relies on qWorkflow library by Ursan Razvan and OneUpdater by Vítor Galvão. The to-do icon is created by Jason Zigrino and released under the Creative Commons BY-NC-ND 3.0 license.

    License
    Things workflow code is released under the MIT License.
×
×
  • Create New...