Jump to content

Terminal

Member
  • Posts

    169
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Terminal

  1. 4 hours ago, gingerbeardman said:

    Some command have strange output obscuring their description, see. automation_trampoline(8)

     

    I also dislike the icon, it's too busy. But I'll just paste over my own choice.

     

    Screen shot 2020-01-15 at 21.20.45.png

     

     

    Funny thing is that is shows up with a man command. So it wasn't the workflow it's self. Anyway, using a regex pattern that strings all random chars from the beginning and end of the descriptions. And since its caching, I didn't notice a noticeable impact on performance. You can either type man workflow:update to trigger the update and then man workflow:delcache to rebuild your cache, or just wait for them to trigger themselves.

     

     

    man -k -P cat . | grep automation_trampoline
    
    
    attach_automation_image(8), -(8) - ."====================== attach_automation_image attach and initialize disk images for automation_trampoline(8) ." ."
    automation_trampoline(8), -(8) - ."====================== automation_trampoline runs automation on boot ." ." ." ."
    makewhatis: /usr/lib/./libgutenprint.2.dylib: No such file or directory

     

  2. 1 hour ago, vitor said:

    Isn’t using the Keychain an option? You can save password there and read them back with the security CLI tool (bundled with macOS). It’s the method I use to save/read API keys in my Workflows.


    Does this prompt you for your password or is it functional without those prompts ?

  3. 1 hour ago, deanishe said:

     

    The problem is that the Quicklook feature relies on the quicklookurl or arg field of each feedback item (i.e. Alfred doesn't call your code again to get the Quicklook version). So you either need to generate the HTML versions in advance before returning the results, or point quicklookurl at a local webserver that can generate them on demand (or load a cached version).

     

    I used the webserver approach to generate previews of events in my Google Calendar workflow. If you decide to go that route, you might be able to crib something useful from that workflow. The preview server shuts itself down after 60s without a request.


    Ah I was misunderstanding you. I’ll have a look! Thanks!

  4. 6 minutes ago, deanishe said:

     

    That would require a Quicklook plugin that handles troff (the format man pages are written in).

     

    The only realistic alternative, AFAIK, is for the workflow to start an HTTP server that generates the HTML versions on demand.


    Currently I do generate a html file and then it’s cached for 30 days. I could make the cache time configurable, but it is already able to build on demand the. Open in a default browser. 
     

    hmmm solutions solutions. 

  5. 20 minutes ago, gingerbeardman said:

    I've just switched to this workflow from the one you were inspired by. So far working great, thanks!

     

    What annoyed me about the old workflow was that every so often it would reindex, and of course you only notice those several seconds when you are in a hurry to look something up and it takes me out of my work zone.

     

    I wonder if it's possible to present the Man page in a Quicklook panel? I usually go with the Terminal approach, but it's not ideal in that it often clutters up my terminal session. I don't like HTML and PDF for similar reasons, and moreso because their apps are even slower to open than Terminal.

     

    18 minutes ago, gingerbeardman said:

    Some command have strange output obscuring their description, see. automation_trampoline(8)

     

    I also dislike the icon, it's too busy. But I'll just paste over my own choice.

     

    Screen shot 2020-01-15 at 21.20.45.png

     

    9 minutes ago, gingerbeardman said:

    Here's the icon I am using, I claim no ownership.

     

     

    man.png


    This is all very valuable feedback. Expect update to resolve these issues within a day. Thankfully, this workflow will auto update!

     

    As for your quick look question, that’s an idea. I’ll research it and see if I can get it working !

  6. Utilizing Alfred amazing launcher abilities, I've got a few workflows that include passing a password to a command, because I didn't want to type decrypt XXXXXXX (Password) I use a Applescript to prompt me for a secure entry dialog and pass that to my commands, any way to add a "Secure Entry" object that is configured to mask input and strip from debug logs ?

  7. 1 hour ago, Kevin Harter said:

    Ditto! I often use it for pasting code, and the preview pane is too small. Would love to make the window much wider. 

     

    On 11/24/2019 at 2:05 PM, sumocomputers said:

    Same Here. I find it super annoying I can't find any window size control.

     

    On 8/5/2019 at 5:50 PM, ssppjj said:

    Hi,

     

    Is it possible to increase the window size for Clipboard history Viewer? I find its current size too small. Thanks!


    Please post in the feature request section to get this some attention. 

  8. 5 minutes ago, vitor said:

     

    The definitely should. You could also make a case for having them in the Workflow’s Data directory (though I’d consider the Cache more appropriate), but the Workflow’s directory is the wrong place as it will sync with the Workflow, taking up more space in the user’s sync solution and getting overwritten when upgrading the Workflow.


    you are completely correct. I’ll have to see if awgo supports retrieving the cache directory. Else I’ll need to figure out a way. 

  9. 19 minutes ago, fredyonge said:

    Hello beautiful people,

     

    i would like to launch either launch my Android or my iOS Simulator, depending on the day/week.

     

    Is there a way so that I can switch between the two paths of starting either simulator  by day or week?

     

    (Reason being, that I write code in React Native which is cross plattform, and I often forget checking the Android side of things, so I would like to automate that)

     

    Thanks in advance!

     

    Greetings

    Fred

     

    To understand fully, something like ?

     

        Monday = Launch iOS Simulator

        Tuesday = Launch iOS Simulator

        Wednesday = Launch Android

        Thursday = Launch Android

        Friday = Launch iOS Simulator

     

     

    if that is the case, you could write a script that checks the day of the week and then launches said value. You would still need to trigger it via a hotkey or keyword type trigger. If you want it automated, then you need to look at something other than Alfred. As Alfred is a launch vs a task scheduler.

  10. Just now, Conanap said:

    Yup I'm referencing with $title, but it doesn't show; I did something like {"items":[ { "title":$title } ] } . I'll keep the Python library in mind, but rn since I'm just reading from a CSV file and adding numbers together I'll probably implement it in a bit.  

    For Python though, I just need to do sys.stdout.write(json obj)?

     

    That is odd.

     

    And yes, for python that call should work just fine.

  11. You need to emit the output in a certain format in order For Alfred to recognize it and automatically insert it into its windows.

     

    If you share what language you are writing it in, I will get an example for you.

     

    The screen below will give you the results.

     

    bIBpWWT.png

  12. 20 minutes ago, flight505 said:

    Hi, I use an app called Franz every day,  I use it for LinkedIn, GitHub, Slack, Discord, trello and Messenger and I switch between four different languages.

    To switch I right-click - Spell checking - "then I choose a language from a list"..  I sometimes do this 25 times a day and it would be very nice just to have a short-cut to switch between the three languages I use the most. Is it possible to do with Alfred or with Automator? if so, could someone perhaps share this command or similar - it would be nice if I only had to change a few things as I don't have a lot of experience with Alfred.

    Thanks

    PS I posted this on reddit and got referred to this forum.. 

     

    Hmm, very interesting requirement, I am not sure it would be easily feasible with Alfred. Franz I believe is a electron app and doesn't have built-in AppleScript support. I am guessing what would really be required is to simulate actually mouse clicks and go through the motions. And if that was the case, Keyboard Maestro would be a more appropriate solution. 

     

    Update

    Checked, doesn't appear to be a great way to go about this. Hopefully someone else here as a better answer. Sorry :( 

  13. Manipulator

    Quick manipulation of strings

     

    Features

    • Fast
    • Encode - URL, HTML, Base64, Binary, URL

    • Decode - URL, HTML, Base64, Binary, URL, Hex

    • Hash - Sha1, 256, 512, MD5

    • Case - CamelCase, LowerCamelCase, Uppercase, Lowercase

    image.thumb.png.3943621d3229ce9fde792563d4e1fab8.png

    image.thumb.png.932cd018a3eefd6f49836125f0da68e2.png

     

    Usage

    1. Keyword: hash, case, encode, decode

    Download

    Github Repo

    Direct Download

     

    Notes

    Working to support more functions such as string encryption, decryption, secure copy to clipboard (Pasteboard ConcealedType...working not implemented), Reversing

  14. Alfred-Man

    This workflow was inspired by Unix man page workflow

    A Unix man page search workflow that supports opening it with the default application (Terminal.app, iTerm2.app), Generating a PDF or HTML and opening them with your default application. PDF and HTML files are generated once when you request them, and then are updated if you open them and their timestamp is 30 day or older.

     

    Features

    • Fast
    • PDF, Terminal, HTML Support
    • Auto Update, Thanks deanishe

    image.thumb.png.a872d659052e2ee3735a604f1d515bc9.png

    Usage

    1. Keyword: ;man
    2. Enter defaults to opening in terminal
    3. CMD + Enter opens as PDF
    4. Option + Enter opens as HTML

     

    Updates

     

    Version 1.2.1

     - Resolved a issue where random symbols weren't stripped from the description. Thanks @gingerbeardman for reporting this issue.

     

    Version 1.2.0

     - Moved pdf/html storage to the workflow cache directory

     

    Download

    Github Repo 

     

    Direct Download

    Notes

    PDF and HTML file update mechanisms may be revisited to determine a better solution. Right now, they are generated and then kept in the workflow directory. Perhaps they should use the cache directory.

     

    Looking to add searching just as Unix man workflow. Such as section specific searches.

     

  15. 2 hours ago, slyfox said:

    I am trying to replace a Keyboard Maestro workflow with Alfred workflow. 

     

    1. CMD+A to select text
    2. Copy to Clipboard
    3. Execute Find & replace
    4. Paste back the results.

     

    For step 3 my report will have this info at the top:

    
    ### Client Info
    
    - Clinic: Advanced Healthcare
    - Name: Mr. John Smith
    - Date of Birth: January 10, 1980
    - Date of Loss: January 10, 2019
    - Date of Assessment: January 10, 2020

     

    I need to find and set variables:

     

    firstName = John

    lastName = Smith

    dob = January 10, 1980

    dol = January 10, 2019

     

    Then replace (content of the report):

     

    NN with firstName --> ([M][r-s]\.\s)(\w*\s)(\w*) - group 2

    XX with lastName --> ([M][r-s]\.\s)(\w*\s)(\w*) - group 3

    DOB with dob --> Date\s\of\s\Birth:\s(\w+\s\d{1,2}\,\s\d{4})

    DOL with dol --> Date\s\of\s\Loss:\s(\w+ \d{1,2},\s\d{4})

     

     

    Screen Shot 2020-01-10 at 9.32.09 PM.png

    Screen Shot 2020-01-10 at 9.22.10 PM.png

     

     

    This definitely can be cleaned up better. But test this out.

     

    A video in action https://gifyu.com/image/mVZs

     

    #!/usr/bin/osascript -l JavaScript
    
    var firstNameReplacement = /(\W|^)NN(\W|$)/gm;
    var lastNameReplacement = /(\W|^)XX(\W|$)/gm;
    var dobReplacement = /(\W|^)DOB(\W|$)/gm;
    var dolReplacement = /(\W|^)DOL(\W|$)/gm;
    
    function getName(s) {
    	let pattern = /Name:\s(?:[M][r-s]\.\s)(\w*)\s(\w*)/;
        return s.match(pattern)
    }
    
    function replaceName(s) {
    	s = s.replace(firstNameReplacement, "$1"+getName(s)[1]+"$2");
    	s = s.replace(lastNameReplacement, "$1"+getName(s)[2]+"$2");
    	return s;
    }
    
    function getDateofBirth(s) {
    	let dob = /(?:Date\sof\sBirth:\s)(\w+\s\d{1,2}\,\s\d{4})/;
        return s.match(dob)[1]
    }
    
    function replaceDOB(s) {
    	s = s.replace(dobReplacement, "$1"+getDateofBirth(s)+"$2");
    	return s;
    }
    
    function getDateofLoss(s) {
    	let dol = /(?:Date\sof\sLoss:\s)(\w+\s\d{1,2}\,\s\d{4})/;
        return s.match(dol)[1]
    }
    
    function replaceDOL(s) {
    	s = s.replace(dolReplacement, "$1"+getDateofLoss(s)+"$2");
    	return s;
    }
    
    
    function run(argv) {
    	var content = argv[0];
    	content = replaceName(content);
    	content = replaceDOB(content);
    	content = replaceDOL(content);
    	return content
    }

     

  16. @slyfox Here is working replacement of DOB

     

    To better help you, what all should this script do? Should one workflow, change pronouns, dob, and name? Or do you want to trigger all of these individually? Can you explain your ideal workflow? As it is completely possible, but without understanding what you are fully trying to accomplish, it is harder to create what you need.

     

     

    #!/usr/bin/osascript -l JavaScript
    
    var dobReplacement = /(\W|^)DOB(\W|$)/gm;
    
    function getDateofBirth(s) {
    	let dob = /(?:Date\sof\sBirth:\s)(\w+\s\d{1,2}\,\s\d{4})/;
        return s.match(dob)[1]
    }
    
    function replaceDOB(s) {
    	s = s.replace(dobReplacement, "$1"+getDateofBirth(s)+"$2");
    	return s;
    }
    
    function run(argv) {
    	return replaceDOB(argv[0]);
    }

     

  17. On 10/10/2019 at 3:28 AM, wandering said:

    Unfortunately, in MacOS Catalina UniCall doen't work anymore.... Due to Apple-restrictions.... (app developer cannot be verified).

     

    On 10/27/2019 at 3:55 PM, kentmoney said:

    Roger that.  It was working for me wonderfully and I was holding off on the Catalina install but I finally thought, "nothing will break now, right?"

     

    Well, it broke it!


     

    I’ll post a solution shortly

×
×
  • Create New...