Jump to content

deanishe

Community Hero
  • Posts

    8,321
  • Joined

  • Last visited

  • Days Won

    499

Reputation Activity

  1. Like
    deanishe reacted to Mingwei in Searchio! Auto-suggestion from search engines in different languages   
    (Just a quick note in case anyone's experiencing a similar problem)
     
    The latest update to the Adguard app (2.6.0.1041) seems to be affecting search suggestions. I'm getting the error 'certificate signed by unknown authority' for both Google and Wikipedia searches (haven't tried others). Worked around this by adding an exception for Alfred in Adguard preferences (Preferences > Network > Applications... > uncheck Alfred from the 'Filtered Applications' list). 
  2. Like
    deanishe got a reaction from GatorMapi in How can Alfred search within file titles, not just from the start letter?   
    Alfred uses word-starts-with semantics: my or file should also match this is my file.doc. To search within words, prepend an asterisk to the search term: *his will match this as well as history.
     
  3. Like
    deanishe reacted to Floating.Point in Run a script whenever Alfred closes   
    Im using Alfred to display a bunch of context sensitive modal menus. My Alfred mode remaps keypad numbers to include the command modifier, so I can execute Alfred list items with a single keystroke. I also temporarily remap some close-by keys to page down and page up so I can quickly move through any longer Alfred modals
  4. Like
    deanishe got a reaction from giovanni in How do I open finder windows with finder tabs in Alfred?   
    This AppleScript will open each of the groups defined at the top of the script in a separate Finder window, with each path in its own tab.
     
    -- each list in groups will be opened in tabs in the same window property groups : {¬ {"~", "~/Documents", "~/Downloads"}, ¬ {"~/Library", "~/Library/Application Support/Alfred", "~/Desktop"}} -- How long to wait (in seconds) between simulated keypresses. -- Increase this value if the script works unreliably property _delay : 0.25 use framework "Foundation" -- expand ~ in path to home directory on normalisePath(_path) set _string to stringWithString_(_path) of NSString of current application set _norm to stringByStandardizingPath of _string return (_norm as string) end normalisePath on run tell application "Finder" activate repeat with _paths in groups -- create new window to open tabs in make new Finder window --open folder "Documents" of home delay _delay -- for each path, open a new tab and navigate to the path repeat with _path in _paths set _path to my normalisePath(_path) -- log "path=" & _path & ", target=" & POSIX path of (target of front window as alias) -- simulate CMD+T to open a new tab tell application "System Events" to keystroke "t" using command down delay _delay set target of front window to (POSIX file _path as alias) delay _delay end repeat -- close initial tab tell application "System Events" keystroke tab using control down keystroke "w" using command down end tell delay _delay end repeat end tell end run  
  5. Thanks
    deanishe got a reaction from Alan He in Keep clipboard history forever   
    +1.
     
    This is the way most similar software works, and makes more sense in terms of any potential downsides of a large history.
     
    A significantly higher limit for plain text items than for images also seems reasonable and useful.
     
  6. Like
    deanishe got a reaction from Floating.Point in Run a script whenever Alfred closes   
    @Mr Pennyworth might have some ideas: he's written a couple of applications that need to know what Alfred's doing. You might be able to use the notification API Andrew added for him, which would be absolutely ideal.
     
    The only thing I can think of is an AppleScript that launches Alfred, then waits for it to close:
     
    -- Do stuff here to enter "Alfred mode" -- Open Alfred tell application id "com.runningwithcrayons.Alfred" to search "" tell application "System Events" tell application process "Alfred" -- Wait for Alfred window to appear repeat while (count windows) = 0 delay 0.1 end repeat log "Alfred open" -- Wait for Alfred window to disappear repeat while (count windows) > 0 delay 0.1 end repeat -- Exit "Alfred mode" here log "Alfred closed" end tell end tell  
    You could do your setup and teardown in the script or before it runs and after it exits.
  7. Like
    deanishe reacted to Alan He in keyword alias   
    Sometimes I want to invoke multiple different keywords, but the execution processing logic is exactly the same at present.
     
    I have to copy it. If logic modify, I have to modify twice.
     
    It's better if Alfred support keyword alias.
     
    To be honest, this requirement may not be used much, but I still want to mention it and see your opinions.
     
     

  8. Like
    deanishe got a reaction from Alan He in keyword alias   
    I'd like to see aliases added, tbh.
     
    People/things have a fairly fuzzy one-to-many relationship with names, and some equivalent of aliases is important in a system is supposed to adapt to the user.
     
    Duplicating Keywords/Script Filters is a poor workaround because any duplicates will get removed if the workflow is updated, while keywords (and by implication aliases) are preserved.
  9. Thanks
    deanishe got a reaction from maindoor in Help creating custom web search - trimming characters   
    Hi @maindoor, welcome to the forum.
     
    That can't be done with a Custom Web Search, I'm afraid: they don't allow you to edit the query.
     
    You need to create a workflow and use a Replace utility to alter the query. Here's an example. It's not very useful because it does exactly what you said (searches mywebsite.com).
     
  10. Like
    deanishe reacted to usmaak in Icons overlapping workflow names on Workflows UI   
    I bought the new one today.  It seems like quite the upgrade from what I had.  Thanks!
  11. Like
    deanishe got a reaction from Chris Messina in Can I use Alfred to compose a group email in Spark client?   
    https://github.com/deanishe/alfred-mailto
  12. Like
    deanishe got a reaction from AndreProducer in What is osascript (JavaScript)?   
    They are. To automate macOS, you need to be able to call its automation APIs. Apple has added official support for doing that to AppleScript and JXA, while very few non-Apple languages are able to call those APIs.
  13. Like
    deanishe got a reaction from Floating.Point in Help me understand why the query won't pass through to this AppleScript   
    There are a couple of problems I can see.
     
    Firstly, you're setting your workflow variable incorrectly:
     

     
    That's the raw value. Don't use quotation marks in there unless the value includes quotation marks.
     
    The major problem is that AppleScript doesn’t let you use a variable in a tell clause the way you’re doing. The variable’s only available at runtime, but AS needs to know the name of the application before then at compile time to look up any app-specific terms you’re using (e.g. DoScript). AFAIK, there's no way to use app-specific terms in AppleScript without hardcoding the application name in the script somewhere.
     
    You should either rewrite your script in JXA (where Application(someVar) works perfectly well) or insert the application name into the AppleScript some other way (i.e. “generate” the AppleScript).
     
  14. Like
    deanishe got a reaction from Floating.Point in Help me understand why the query won't pass through to this AppleScript   
    No. Quotes are used to insert string (text) literals into source code. Without quotes, it's not text, it's code, and the interpreter will try (and fail) to execute it.
  15. Thanks
    deanishe got a reaction from Acidham in Alfred Markdown Notes   
    Might be worth talking to Notebooks' developers about that. There's no real consensus, but many Markdown parsers require headings to have a space after the # sign, so #this is rendered as normal text and # this is a heading.
     
  16. Like
    deanishe got a reaction from bongobong in What's wrong with my 2do script?   
    I don't think you're getting that far. The way you're trying to join the URL is all wrong. It needs to be:
     
    set myVariable to "some string" & someVariable & "another string"
     
    You forgot the & signs.
     
    As regards URL-encoding: AppleScript can't do it. Unless you can find a function someone has written, you'll need to use a different language for that.
  17. Like
    deanishe reacted to Vijay Kumar Sharma in Better Dictionaries   
    Deanishe, grateful for taking time out for me with the detailed response. Helps my understanding. I have been checking the service, but it hasn't been working as yet. Unsure, what other services are available and where, which I can tap in. Shall try to google and find out. Many thanks once again.   
  18. Like
    deanishe got a reaction from xurc in Goodreads Book Search   
    Massive update today. Complete rewrite, basically.
     
    The workflow now uses OAuth, so you can access your own bookshelves and add/remove books.
     
    I've replaced custom URLs with custom scripts, so you can do just about anything with book data, not just open URLs.
     
    The workflow can now also fetch a book's full dataset, so there are a lot more data to play with (e.g. book description, which is available as plaintext, HTML or Markdown).
  19. Like
    deanishe reacted to jopemachine in Search for Nintendo switch game prices by country   
    I've never noticed the value is totally wrong..
     
    In 0.1.3, I changed the variable name to currency back again.
     
    And I specified possible variable names table in Github readme.
     
    Thanks for your comments again
     
  20. Thanks
    deanishe got a reaction from jopemachine in Search for Nintendo switch game prices by country   
    The value in the URL is currency, and that’s what you should call the variable.
     
    Looking at the site, "EN" isn't actually a valid value. It redirects to "GBP", which is the currency code for pounds sterling, not any kind of dollar.
  21. Like
    deanishe got a reaction from giovanni in Parse string into multiple variables?   
    It can be done, but will only work properly if there are never any dashes in the individual elements.
  22. Like
    deanishe got a reaction from Floating.Point in Copy file URL (path) and add some characters   
    I'm afraid it's not that simple.
     
    You're copying a filepath, not a URL, and they have different rules, so you can’t just stick file:// in front of a path to make a URL. Sometimes it works, but a whole bunch of characters that are allowed in paths are not allowed in URLs.
     
    You need to URL-encode the path to get a valid URL, and in your case, it needs additional processing to ensure it works with Markdown (closing parentheses are allowed in URLs, but need escaping or encoding inside Markdown links or the URL will be truncated at the first closing parenthesis).
     
    Here's a JXA function you could stick in a File Action (which is the best way to pass a selected file to Alfred):
     
    // convert POSIX path (e.g. /path/to/file) to a Markdown URL function markdownUrl(path) { // encode path for use in a URL let url = 'file://' + encodeURI(path) // also encode parentheses to ensure a valid Markdown URL url = url.replace('(', '%28').replace(')', '%29') // return Markdown-formatted URL return `[](${url})` } function run(argv) { // first command-line argument is the filepath return markdownUrl(argv[0]) }  
    Put it in a Run Script Action with Language = "/usr/bin/osascript (JS)" and with "input as argv"
     
  23. Thanks
    deanishe got a reaction from Martin Packer in Universal Actions Contextual Menu   
    There's already a Popclip extension for Alfred. Wouldn't take much editing to make it work with Universal Actions.
  24. Like
    deanishe got a reaction from GatorMapi in OpenSearch vs SearchAction   
    They are two different ways for a website to specify how to search it. They both do the same thing, but not all software supports both, much like RSS vs Atom.
     
    MediaWiki only supports OpenSearch, for example, so if you put https://en.wikipedia.org/wiki/Main_Page into the Search URL box and hit Lookup, you'll only see a result for OpenSearch.
     
    Most websites support neither, however. Normally, you'll have to figure out the correct search URL on your own.
  25. Thanks
    deanishe got a reaction from giovanni in Copy file URL (path) and add some characters   
    It’s not the script, it’s /usr/bin/osascript adding the newline, so no, it can’t be avoided I'm afraid. You'll have to trim the string afterwards if the newline is a problem.
×
×
  • Create New...