Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    523

Reputation Activity

  1. Like
    deanishe got a reaction from MEs in Create a workflow with files embedded in the .workflow   
    info.plist and icon.png need to be in the workflow root directory. Beyond that, it's entirely up to you to do what you feel is best for the workflow and language you're using.
     
    In the case of workflows written in Python, subdirectories are often 3rd-party libraries bundled with the workflow.
  2. Like
    deanishe got a reaction from MEs in [Solved] Mount / Unmount a shared network drive   
    http://apple.stackexchange.com/a/698
  3. Like
    deanishe got a reaction from MEs in [Solved] Mount / Unmount a shared network drive   
    To simulate pressing return, use:
     
    tell application "System Events" to key code 36
    I don't know about any of the other stuff because I don't have any remote volumes.
  4. Like
    deanishe got a reaction from MEs in [Solved] Mount / Unmount a shared network drive   
    Yes. Just use a Run Script Action with Language = /bin/bash
     
    It's generally a better idea to also use Run Script Actions to run AppleScript, too, by setting Language = /usr/bin/osascript (AS)
     
    The reason is that Run NSAppleScript runs the script on Alfred's main thread, which blocks Alfred till the script finishes. The normal Run Script action runs in the background, so you can keep using Alfred.
     
    However, because AppleScript is weird, sometimes one will work but the other won't.
  5. Like
    deanishe got a reaction from rounak in How to update List Filter?   
    This really isn't the right way to do it. You should use a Script Filter instead. That's what they're designed for.
    Instead of editing info.plist, save the JSON data to a file and set your Script Filter script to:

    cat /path/to/json_data.jsonCan Filemaker export an Excel file? If so, you could use this workflow to display the contents of the Excel file in Alfred. It automatically picks up changes to the Excel file.
  6. Like
    deanishe got a reaction from rounak in How to update List Filter?   
    I found a JSON library for AppleScript. That would ensure your script handles all input correctly (if you think that might be an issue).
  7. Like
    deanishe got a reaction from rounak in How to update List Filter?   
    If yours works, then fine. There is a latent bug in the JSON generation, however, and it will explode if, say, a backslash or double quote pops up in one of your values (because you aren't escaping the strings before you add them to your JSON, as best as I can tell).

    WRT the workflow I linked to, there was a bug that required there to be three columns. Fixed now. Redownload (version 0.1.1) and set SUBTITLE_COL and VALUE_COL to 0 (zero) in the config sheet.

    There's no need to duplicate the workflow yourself: You can use the keyword isyn to search for and choose an Excel file. There's no need to put your excel file in the workflow (that's kind of the point). The workflow will notice whenever the file changes.
     
    I'm afraid I haven't documented the workflow properly yet. You can download and watch the demo here (it's too big to view on GitHub).

    You can also read the program's built-in help by running the isyn program in the workflow directory in your terminal with ./isyn -h
  8. Like
    deanishe reacted to jeffsui in Thank you 3.1   
    I was going to request a way to auto-refresh workflow results in alfred but it looks like a combo of the "hide Alfred" command and the external triggers has allowed me to do EXACTLY what i want.
     
    Thanks for the update!
  9. Like
    deanishe reacted to emamuna in A simple Windows Switcher   
    Thank you danish both for your answer about v2 compatibility and for the great work you did with alfred-workflow.
    I'll use your (wonderful) python library for sure, as I did for every workflow I wrote (except this one ofc!)
    As regards the caching system, I don't know if I could use the built-in method in your library , because I want to cache just the process name with the ico-path related to that application.
  10. Like
    deanishe got a reaction from emamuna in A simple Windows Switcher   
    That's a no-go, I'm afraid. If you built the workflow with Alfred 3, it will not work in Alfred 2. It doesn't matter whether it uses 3-only features or not, unfortunately.
     
     
    If you do, there's my Python library, which has decent caching smarts built in (it's fundamentally designed around using cached data for speed while updating the cache in the background).
     
    It can also take care of other tedious crap like updating the workflow, and the fuzzy search would be a great fit for your workflow.
  11. Like
    deanishe got a reaction from jdargo in Text expansion into bold and placement on page   
    Nope. Alfred's snippets are currently plaintext only, and you need rich text support for that.
    Alfred's snippet engine is extremely limited compared to TE. If you need TE's extensive capabilities, I'd recommend Typinator. It supports essentially all the same features as TextExpander and can even import all your TextExpander snippets almost perfectly.
    It looks like butt compared to TE (and Alfred), but it does the job very well, and cursor placement (which Alfred doesn't support) is way faster than TE.
  12. Like
    deanishe got a reaction from rounak in re-activate Alfred after running an action   
    If I tried to make you a workflow, it would most likely be broken because I don't have Evernote to test it with.
     
    Step 3 isn't possible. If you enter "co " into Alfred (using the keyboard or AppleScript), it will search for "co". That's just how Alfred works.
     
    That shouldn't be an issue, however. After you've used your workflow a couple of times, Alfred will associate it with the query "co" and it will always be the top result. Just keep typing.
     
    To use an External Trigger, first you create the External Trigger and connect it to your Script Filter (or whatever it is you want to launch). Then you add a Call External Trigger Output (or use the provided AppleScript) to call it at the end of your action.
     
    Also, this is broken: on run {query}
     
    {query} is a placeholder. When Alfred runs your script, it does a search-and-replace for {query} and replaces it with the input.
     
    If you enter the text "next line of my note", your script now reads on run next line of my note, which is not valid AppleScript.

    Whether you use input as argv or {query}, follow the template Alfred gives you.
  13. Like
    deanishe got a reaction from qiunet in How to return from child shell.   
    What's the problem exactly? What are you expecting to happen?
     
    If you're expecting the Alfred subprocess to exit, but it isn't, it might be because you haven't detached from the standard streams. In that case, you'd probably need something like: 
     
    nohup ssh -D 7788 User@HostIp  -p RemotePort -Nf &> /dev/null &
  14. Like
    deanishe got a reaction from jmm28260 in Unfold or fold all folders and subfolders in directory   
    Okay then. The best way to do this is probably to simulate the CMD+OPT+Right Arrow keypress with AppleScript, like this: 
     
    tell application "System Events" to key code 124 using {command down, option down}
     
    In an Alfred workflow, put that in a Run Script Action with Language = /usr/bin/osascript (AS).

    It's up to you to ensure that Finder is the active application and the correct folder is selected, however. If you want to automate that, too, this will show your home folder in Finder in List View:
     
    property theTarget : get path to home folder
    tell application "Finder"
        activate
        tell front Finder window
            set current view to list view
            reveal theTarget
        end tell
    end tell

    Can't say much more than that without more details of precisely what you want to do (open the same folder every time, choose the folder to open in Alfred etc.)
  15. Like
    deanishe got a reaction from Joe7 in Asana Workflow   
    Please don't ask users to install gems globally to make your workflow work. It's bad practice and user-unfriendly.
     
    There's a good chance your workflow will break something else, or that some other software doing the same suspect thing will break your workflow (because they require different library versions, and Ruby doesn't support versioned libraries).
     
    Please bundle any dependencies with your workflow. That way it will work out of the box, won't cause problems with other software, doesn't require users to mess about in Terminal, and it will also sync seamlessly between machines. And when you update the dependencies, users won't have to go through it all over again. They can just install the new version of the workflow.
  16. Like
    deanishe got a reaction from jeffsui in Batch workflow metadata update and export   
    Here's the build script I use.
     
    It's tailored to Python and the Alfred-Workflow library, so you'd probably want to change it (i.e. it excludes Python-specific files from the build and reads the workflow version number from a version file, which Alfred-Workflow expects to be present).
  17. Like
    deanishe reacted to Vero in Multiple hotkeys to invoke Alfred?   
    You could set a hotkey with the action set to "Show Alfred", which is the simplest way to achieve this
     
    Cheers,
    Vero
  18. Like
    deanishe reacted to dfay in Running AppleScript unintentionally reopens Alfred bar efter closing   
    Are you using option-space as your hotkey for Alfred?  The script is trying to get Evernote to do something by simulating an option-space keypress in System Events.
  19. Like
    deanishe got a reaction from jeffsui in Including a unix binary (and calling it) within an Alfred workflow - how?   
    Well, you'll need to call it with a leading ./ (e.g. ./myprog not just myprog) to tell the shell it's in the working directory, not on PATH.
  20. Like
    deanishe got a reaction from licknau in Move mouse pointer to currently active/focused Window   
    This script moves the mouse cursor to the centre of the frontmost window. Put it in a Run Script action with Language = /usr/bin/osascript (JS).
     
    I have no idea if it works with multiple monitors.
     
    ObjC.import('stdlib') ObjC.import('CoreGraphics'); // Move mouse cursor to specified position function moveMouse(x, y) { var pos = $.CGPointMake(x, y); var event = $.CGEventCreateMouseEvent(null, $.kCGEventMouseMoved, pos, $.kCGMouseButtonLeft); $.CGEventPost($.kCGHIDEventTap, event); } // Run script function run() { var app = Application.currentApplication(); app.includeStandardAdditions = true; var win = app.windows[0], bounds = win.properties().bounds; // Calculate centre of window var x = Math.trunc(bounds.x + (bounds.width / 2)), y = Math.trunc(bounds.y + (bounds.height / 2)); console.log('centre = ' + x + 'x' + y); moveMouse(x, y); }
  21. Like
    deanishe got a reaction from sgoldstein in Do Workflows allow form inputs?   
    Alfred is not a replacement for Keyboard Maestro (what is?). They are entirely different kinds of applications.
     
    Workflows, at heart, allow you to put your own data into Alfred's GUI, select an item and perform an action on/with it.
     
    Alfred is not suited to automating other applications. Workflows that work with other applications are more like hyper-convenient Quick Entry or Quick Search features, i.e. one-shot actions.
     
    If you try to use Alfred for any kind of multi-step automation, like filling forms, you'll basically be doing 99% of the work yourself in AppleScript and just using Alfred to run the script.
  22. Like
    deanishe reacted to altre in Python Interpreter   
    Hey everyone,
     
    Here's a workflow I created a while ago and have been using quite alot myself:
     
    Alfred Workflow: Python Interpreter The full power of python at your fingertips.Evaluate or run python commands directly from Alfred.
    Hit enter to copy output to clipboard.
    This workflow automatically imports the following standard libraries as star-imports: math, random, re, calendar, os.path, shutil, json, time, macostools.
    Furthermore it attempts to import numpy as star import and ignores it silently if not installed.
    Get it here:
    https://github.com/altre/alfred_python_interpreter
    http://www.packal.org/workflow/python-interpreter
     
     
     

     
     
  23. Like
    deanishe got a reaction from nikivi in Snippets with links and formatting   
    I dunno if it's worth the price to you, but Typinator can do pretty much everything you'd ever want from a snippet expander.
  24. Like
    deanishe got a reaction from nikivi in Searchio! Auto-suggestion from search engines in different languages   
    The default behaviour is to only show your query as a result if no other results are returned.
     
    This can be altered, as detailed in the help file.
     
    Enter searchio in Alfred (which will show the workflow's settings) and hit ENTER on the second item (Show query in results). That will always show your query as the top result.
     
    Does that help?
  25. Like
    deanishe reacted to deanishe in Searchio! Auto-suggestion from search engines in different languages   
    The default behaviour is to only show your query as a result if no other results are returned.
     
    This can be altered, as detailed in the help file.
     
    Enter searchio in Alfred (which will show the workflow's settings) and hit ENTER on the second item (Show query in results). That will always show your query as the top result.
     
    Does that help?
×
×
  • Create New...