Jump to content

nilsdog

Member
  • Posts

    10
  • Joined

  • Last visited

Posts posted by nilsdog

  1. Ahh, I see. You were correct - the script was referencing the wrong location. Thanks @deanishe !

     

    For anyone that stumbles across this and wants a fix, I simply deleted the nested if statement within the first NSApplescript (found in the workflow object window) – this made it work for me.

     

    on alfred_script(q)
    
    -- {sys1, sys2, sys3 } = { major, minor, bugfix}
    set minor_ver to system attribute "sys2" 
    
    set contacts_running to false
    if application "Contacts" is running then
     set contacts_running to true
    else
    	-- Catalina (10.15) moved the location of Contacts.app
    	if 14 ≤ minor_ver then
    		do shell script "open -j /Applications/Contacts.app"
    	else
    		do shell script "open -j /System/Applications/Contacts.app"
    	end if
    end if
    
    tell application "Contacts"
     set q to text ((offset of "Metadata/" in q)+9) thru ((offset of "." in q)-1) of q
     set phonenumber to value of phone of person id q
     set phonenumber to item 1 of phonenumber
    end tell
    
    if contacts_running is false
     tell application "Contacts" to quit
    end if
    
    return phonenumber
    end alfred_script
    
  2. ok sure, thanks @deanishe

     

    Sorry for the lack of descriptive info.

     

    Debug Mode yielded the below:

     

    –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

     

    [5:23:37.102 pm] Logging Started...

    [5:24:24.267 pm] Call or SMS contact[File Filter] Processing complete

    [5:24:24.279 pm] Call or SMS contact[File Filter] Passing output '/Users/nilsdog/Library/Application Support/AddressBook/Sources/F134E7C6-4FAC-4032-A80C-CF0779BA2841/Metadata/71E705CA-9CC6-4801-B529-9240EBF0BB5C:ABPerson.abcdp' to Arg and Vars

    [5:24:24.280 pm] Call or SMS contact[Arg and Vars] Processing complete

    [5:24:24.280 pm] Call or SMS contact[Arg and Vars] Passing output '/Users/nilsdog/Library/Application Support/AddressBook/Sources/F134E7C6-4FAC-4032-A80C-CF0779BA2841/Metadata/71E705CA-9CC6-4801-B529-9240EBF0BB5C:ABPerson.abcdp' to Run NSAppleScript

    [5:24:24.312 pm] ERROR: Call or SMS contact[Run NSAppleScript] {

        NSAppleScriptErrorAppName = "Alfred 4";

        NSAppleScriptErrorBriefMessage = "The file /Applications/Contacts.app does not exist.";

        NSAppleScriptErrorMessage = "The file /Applications/Contacts.app does not exist.";

        NSAppleScriptErrorNumber = 1;

        NSAppleScriptErrorRange = "NSRange: {297, 60}";

    }

    [5:24:24.317 pm] Call or SMS contact[Run NSAppleScript] Processing complete

    [5:24:24.317 pm] Call or SMS contact[Run NSAppleScript] Passing output '' to Replace

    [5:24:24.318 pm] Call or SMS contact[Replace] Processing complete

    [5:24:24.318 pm] Call or SMS contact[Replace] Passing output '' to Run Script

    [5:24:24.546 pm] Call or SMS contact[Run Script] Processing complete

    [5:24:24.550 pm] Call or SMS contact[Run Script] Passing output '' to Filter

     

    –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

     

    Not sure why it's telling me the contacts app doesn't exist, as I can see it in my applications folder?

     

    I guess I would need to update the applescript's path for where contacts is, but it looks correct from what I can see:

     

    –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

     

    on alfred_script(q)
    
    -- {sys1, sys2, sys3 } = { major, minor, bugfix}
    set minor_ver to system attribute "sys2" 
    
    set contacts_running to false
    if application "Contacts" is running then
     set contacts_running to true
    else
    	-- Catalina (10.15) moved the location of Contacts.app
    	if 14 ≤ minor_ver then
    		do shell script "open -j /Applications/Contacts.app"
    	else
    		do shell script "open -j /System/Applications/Contacts.app"
    	end if
    end if
    
    tell application "Contacts"
     set q to text ((offset of "Metadata/" in q)+9) thru ((offset of "." in q)-1) of q
     set phonenumber to value of phone of person id q
     set phonenumber to item 1 of phonenumber
    end tell
    
    if contacts_running is false
     tell application "Contacts" to quit
    end if
    
    return phonenumber
    end alfred_script

     

    I know this is nothing to do with you (so thank you for your previous response), but if you have a moment; any thoughts?

  3. My apologies, I realised yesterday that functionally it made no difference as I didn't need to hit enter.

     

    I just think its visually nicer hitting enter as it means Alfred stops including non-relevant searches when activating the workflow (like listing the OneDrive application) amongst the OneNote pages.

     

    I'm also a stickler for inconsistencies so I can become (unproductively) obsessed with them  ;D

  4. The typical finance terminology for foreign exchange would be: USD GBP

     

    The assumption is obviously that the first currency is set to one, however the workflow requires me to type 1 each time for a conversion.

     

    Would it be possible to update the workflow so it recognises the first item in the currency pair will be set to 1 should the user not specify otherwise?

  5. Hi there,

     

    Before going on, I know Alfred automatically orders results in order of most used. However I'm experiencing inconsistent rules with regard to this.

     

    I have both the Microsoft OneNote & Outlook applications installed on my computer, and when I want to pull them up it's useful that I type in the first few letters (e.g. "one" & "out" with no space), and both applications show first in results, so I can easily just hit enter on the first result. Furthermore, I have two separate workflows for searching each of these in Alfred. The keywords for these have been set to "out" and "one".

     

    When I search with "out" followed by a space, Alfred will only list the Outlook search workflow, and not the application at all. However, for some reason when I type "one" followed by a space, the OneNote application always defaults to the first result, followed by the search workflow second. This is super annoying as each time I can't just hit enter like I do with the outlook workflow.

     

    I've tried in vain typing "out" followed by a space many times and manually selecting the search workflow, to try to get Alfred to understand I'll never want to open the application if I've followed the term with a space.

     

    Anyone know what I can do to fix this? 

    Screenshot 2020-06-19 at 17.41.08.png

    Screenshot 2020-06-19 at 17.41.22.png

  6. Hi there,

     

    I recently downloaded Vero's workflow, which seemed like the solution to searching / finding calendar events.

     

    However when I return a result in the search, I receive a dialog box asking me which destination calendar I'd like to import the calendar file to.

     

    I just want hitting enter to open and show the event within the macOS default calendar app. Is this possible?

×
×
  • Create New...