Jump to content

petebocken

Member
  • Posts

    48
  • Joined

  • Last visited

Posts posted by petebocken

  1. 1 hour ago, pdy said:

     

    I see. In your case, a phone number can contain brackets. Try the following script.

     

    query="{query}"
    
    phone_num=$(/usr/libexec/PlistBuddy -c 'Print:Phone' "$query" | grep -o -m 1 '^[[:space:]]*\(+\?[[:digit:][:space:])(-]\+\)[:space:]\?$')
    
    echo -n $phone_num

     

     

    That works, thanks so much!

  2. % /usr/libexec/PlistBuddy -c 'Print:Phone' '/Users/peter/Library/Application Support/AddressBook/Sources/336CF002-F2FC-41D8-B761-68FBD7A53613/Metadata/52299394-FE3F-4A59-9F22-73EDC8AADDEA:ABPerson.abcdp'
    Dict {
        identifiers = Array {
            5CDBF59B-7C58-433A-99F6-6B5666376541
            E3628392-C195-46C1-BE38-F5C3B709A3FD
        }
        values = Array {
            1 (800) 872-2657
            (612) 872-2657
        }
        primary = 5CDBF59B-7C58-433A-99F6-6B5666376541
        labels = Array {
            _$!<Main>!$_
            _$!<Work>!$_
        }
    }

     

  3. 15 hours ago, pdy said:

     

    The workflow uses an applescript to extract a phone number from a contact name. 

     

    Just replace it with a bash/zsh script.

     

    431803112_Screenshot2022-11-15at09_04_36.thumb.png.d48b7e1ccaaaae3fe1a4a77e1946c2a6.png

    image.png

     

    Thanks! It appears to work, but not for every contact in my address book. Can't really figure out a rhyme or reason though.

  4. 15 hours ago, pdy said:
    query="{query}"
    
    phone_num=$(/usr/libexec/PlistBuddy -c 'Print:Phone' "$query" | grep -o -m 1 '^[[:space:]]*\(+\?[[:digit:][:space:]-]\+\)[:space:]\?$')
    
    echo -n $phone_num

     


    I have temporarily fixed the problem by replacing the appleScript to extract a phone number with the above bash script.

     

    Hope this helps :)

     

    Reference: https://www.alfredforum.com/topic/19240-search-and-pass-contacts-phone-number/

     

    Which does this script go?

     

  5. Thanks @Vero. One thing of note that the workflow does is allow you to call any number by typing for example "call 18004444444" instead of only your contacts. I use this all the time with Handoff at my Mac to never have to pickup my iPhone to call my contacts but also any number, as well as answering incoming calls.

     

    I've tested on macOS 13 Ventura and the workflow still functions. However, the FaceTime app opens in the foreground and starts the camera (just like the native Alfred call function does). In Big Sur, it did not do this. It would just leave the FaceTime app in the background and not turn on the camera.

  6. I've probably created quite the convoluted workflow, but it appears to work exactly how I want...

     

    I want to have a single hotkey (I'm actually assigning this as a single key on my keyboard) that when executed gives me a list of 3 keyword actions (open the Fantastical new event, open the Todoist new task and open a new Craft doc). I've prefixed all 3 keywords with "add!-" and then my Hotkey has a text argument with that text. So that way when the Hotkey is pressed, it only shows the 3 actions. This works perfectly, however the order the "Task", "Event" and "Note" actions show up in Alfred are not the same each time. The latest action is always at the top.

     

    1) Is there a more obvious way to achieve the function I'm looking for here (I'm happy to keep what I have since it works), but out of curiosity I would be interested in the better way.

    2) Is it possible to keep the same order for these keywords each time or is the last used keyword always displayed at the top?

    1.png

    2.png

    3.png

  7. @Acidham no, I mean to not have to type a keyword at all. Just be able to type the shortcut name in Alfred and search my Shortcuts and run.

     

    So like this:

    1. Open Alfred

    2. Type “Shorten URL”

     

    Instead of:

    1. Open Alfred

    2. Type: “sc Shorten URL”

     

    I know you can do this by using a hot key, but I want to do it normally through bringing up Alfred with the set command (command+space).

     

  8. I’d like to create a workflow that runs a specific command in another workflow.

     

    For example: I would like to create a keyword to run a particular Keyboard Maestro macro. I’m using Conductor (https://www.thoughtasylum.com/2021/03/23/alfred-workflow-keyboard-maestro/ but it requires you to type “km” at the front of the keyword.

     

    So essentially I’d like to be able to type my own custom keyword that types a specific different keyword into Alfred.

  9. 12 minutes ago, sballin said:

    Thanks! Could you try changing the first line in get_notes.py from #!/usr/bin/env python3 to #!/usr/bin/python3? If that doesn't work, you may need to install the xcode command line tools using the command

    
    xcode-select --install

    Sorry for the trouble, I was hoping it would work out of the box.

     

    Thanks. Installing xcode command line tools fixed it.

  10. 2 minutes ago, sballin said:

     

    As always, I'll need to see some debug logs before I can help.

     

    Ah sorry. Never actually enabled debugging on a workflow before. Here you go.

     

    [08:03:39.469] ERROR: Search Notes[Script Filter] Code 1: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

     

    Checked my disk and the only folder I have in CommandLineTools/usr is "share".  No "bin".

  11. 4 hours ago, sballin said:

    Version 2.0.0 released! The workflow now runs on python 3 and lets you copy note bodies with cmd+enter and search note bodies with a new keyword.

     

    Other minor changes: include version number, drop confusing .app.alfredworkflow extension, add please wait subtext. I don't think it's possible to have text indicating that no result was found.

     

    Updated and now nothing works. I'm on 10.15.2. 🤷‍♂️

  12. 8 hours ago, bzzzl said:

    This workflow has stopped working for me. Not sure what Ive done but it used to work as Is by typing "N" but that stopped working. I switched to using the compatible command "an" but now that doesn't populate with any of my recent notes. I'm on Mojave, latest version 

     

    Still working for me on 10.14.6 (with the supplemental update from 8/26).

  13. 36 minutes ago, sballin said:

    It should be possible, but isn't that duplicating the functionality of Alfred snippets?

     

     

    In some way yes. However, I keep all my code snippets in Notes, so simply searching and copying them to the clipboard would work very well.

  14. Even more fun.  Added another keyword in the workflow to only download the audio from the YouTube video and then drop it in the "Automatically Add to iTunes" folder. :D

     

    /usr/local/bin/youtube-dl -f m4a --ffmpeg-location /usr/local/bin/ffmpeg -q -o "/Users/peter/Music/iTunes/iTunes Media/Automatically Add to iTunes/%(title)s.%(ext)s" "$url"; echo "Completed";

     

    I could only get m4a working, the rest said the requested format not available.  M4A works in iTunes just fine.

  15. 12 minutes ago, deanishe said:

     

    Never heard that before. Had to look it up. Quite a useful expression. Thanks!

     

    I just dug out an old script that wraps youtube-dl. --ffmpeg-location /usr/local/bin/ffmpeg is likely the option you need.

     

    YAHTZEE!  IT WORKS! 

     

    /usr/local/bin/youtube-dl -f bestvideo+bestaudio --ffmpeg-location /usr/local/bin/ffmpeg -q -o "/path-where-files-are-stored/%(title)s.%(ext)s" "$url"; echo "Completed";

  16. 1 minute ago, deanishe said:

    So you used exactly the same command in a shell and got a different result? Or you used a (even slightly) different command in the shell and got a different result?

     

    In either case, your question now requires knowledge of youtube-dl, not (just) Alfred. I certainly don't have it, David rarely posts anymore, and I don't know about anyone else. As such, I think your best bet for a fast solution is the youtube-dl site. 

     

     

     

    Ya, figured we were getting into the weeds.  Thanks @deanishe

×
×
  • Create New...