Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    522

Reputation Activity

  1. 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).
     
  2. 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.
  3. 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.
     
  4. 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.
  5. 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.   
  6. 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).
  7. 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
     
  8. 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.
  9. 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.
  10. 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"
     
  11. 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.
  12. 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.
  13. 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.
  14. Like
    deanishe reacted to andreas.w in Search and add bookmarks to Raindrop.io   
    Just released version 2.0!
     
    This is something that I realized maybe a year ago that I wanted to do eventually, to rewrite all the PHP and Python (which is almost all of what this workflow used to be) in a way that will make it work without external dependencies when Apple stops providing PHP and Python with the OS (which has been know for a while that they will eventually stop doing)
     
    With macOS 12 Monterey, which will be released possibly as soon as the coming week (but more likely next month), PHP will be gone, which means that this workflow would not function if you did not manually install PHP yourself, and while I did some changes in version 1.7 recently to make the workflow function with a version of PHP that you have installed yourself, I do really not like the idea of requiring PHP to be manually installed for my workflow to function, and it is also just a matter of time before Python goes away as well. Likely next year.
     
    So I have rewritten everything that was written in PHP and Python in Go instead. Which means that almost everything is entirely rewritten (there is just a bit of AppleScript that has only changed a little)
     
    Go is a compiled programming language, and it does not require any runtime to be installed to function once the code is compiled. This means that the workflow is not dependent on Apple to provide support for something like PHP or Python in macOS anymore, and Go also has the added benefit of being faster than a scripting language like PHP.
     
    Version 2.0 does not really look or behave as different as the version bump might indicate, but almost everything has changed underneath to make this a better workflow.
    Rewritten in Go, so no dependency on PHP or Python anymore. This is important, as Apple is removing PHP from macOS 12 Monterey, and will also remove Python from macOS in the future. It's faster! Running the backend of the workflow as a compiled binary (Go) instead of a script (PHP) makes it faster, and it is also compiled as a universal binary, so it's running natively on both Apple Silicon and Intel Macs, but there are also some other changes that helps to make it faster and you will probably notice the difference if you used the old version before. Less risk for unexpected behavior that leads to bugs, both because it can't behave different depending on which PHP or Python version you have anymore, but also because it now for example uses more reliable ways to keep track of information while navigating through the different parts of the workflow. Adding bookmarks from Firefox is now more reliable, and if things still occasionally go wrong, the workflow is better at communication that in a useful way. (I switched from Safari to Firefox myself, so it got some more attention than before) Ability to add a bookmark by copying the address, rather than getting it from the currently active browser window. To use this feature for adding a bookmark from an unsupported browser (or somewhere else), just copy the address and go to the bookmark adding feature of this workflow. It will just work, without you having to do anything more than that! Get it from GitHub!
  15. Like
    deanishe got a reaction from Sucesso in Basic question: How to add a second step to a workflow? (I want to replace /n with | and then trim whitespace)   
    Check which whitespace is in your input. It might be some exotic Unicode that doesn't match the regex above.
  16. Like
    deanishe got a reaction from harryb in Show "Tags" results in a folder   
    You need to do a bit of UI scripting with Finder to achieve that.
     
    Here's an example workflow that does what you ask.
  17. Like
    deanishe reacted to Kaske in Google Drive Search (via Google Drive File Stream)   
    I also found this, might be releated?
     
    https://apple.stackexchange.com/questions/420959/spotlight-indexing-of-google-drive-file-stream-disabled-on-restart
  18. Thanks
    deanishe got a reaction from Hans-Pe in How to invoke Automator Quick Action with Alfred File Action?   
    You can run Automator workflows with the /usr/bin/automator command-line program:

    /usr/bin/automator -i /path/to/input/file /path/to/workflow.workflow
     
  19. Like
    deanishe got a reaction from Rohit in Unable to delete workflows   
    Sounds like you'll have to open each workflow in Finder, then move it to your Desktop, then delete it.
     
    Alternatively, you could use rm -rf in Terminal.app if you’re comfortable with a shell.
     
  20. Like
    deanishe got a reaction from able in Does Slapdash do anything Alfred workflows don't?   
    That sounds like a question for a Slapdash forum, tbh – there aren't going to be many Alfred users who used to use Slapdash.
     
    Looking over the docs, it appears to have more built-in integrations, but a much more limited ability to add your own stuff to it. Especially if you're not a programmer. I couldn't say if there's an Alfred workflow for all of Slapdash's integrations because I use almost none of those services, but there are definitely workflows for a lot of them.
     
    It's also built on Electron, so it's a bloated, fat pig compared to Alfred. The application is 20x the size of Alfred, it uses a hell of a lot more memory, too, and its HTML-based UI is nowhere near as performant as Alfred's native one. I guess the clue is in the name…
     
    Alfred works perfectly well without an Internet connection; Slapdash does not.
     
    Finally, Slapdash is eye-wateringly expensive compared to Alfred. A lifetime Alfred licence costs about the same as 6 months of Slapdash.
  21. Like
    deanishe reacted to Andrew in Using PHP on Monterey (macOS 12)?   
    Just as a quick update on this, when I release the next version, the bin error dialog now gives a few more useful options allowing for workflow to be opened or disabled so you don't see the issue again:
     

    Alfred will also search for alternative paths when the macOS standard bin path is missing, e.g. for php Alfred will also look in:
     
    /opt/homebrew/bin/php /usr/local/bin/php  
    I have some more changes I want to implement for the next release, however, there is a good chance I'll do an interim build in the next few days which will contain this change, allowing for macOS 12 users to use php workflows if they have an alternative php installed (e.g. via homebrew).
     
    Cheers,
    Andrew
  22. Like
    deanishe got a reaction from GMN in Can I use a variable inside a {clipboard} macro instead of a preset number?   
    No.
     
     
    You didn't actually explain what it is you're trying to do…
     
    If you're trying to expand one macro within another, it's {clipboard:{query}} or {clipboard:{var:varname}}.
     
  23. Like
    deanishe got a reaction from Stephen_C in Is Alfred ready for 1Password 8?   
    They did something similar when they introduced the cloud version. Kept telling everyone they could still keep using 1Password with local vaults while deflecting all the questions about why they needed to pay three times as much to do so.
  24. Like
    deanishe reacted to vitor in Is Alfred ready for 1Password 8?   
    I can relate to the worries: Electron is known for being a resource hog and node projects are known for their security problems. On a security-minded app, that is an especially important point to address.

    They’re also getting a lot of flack for having taken VC money. People have been burned too often by companies who take investments in the name of growth and as a result undergo a huge shift in priorities, caring for businesses over individual users. That is their choice to make, and they should own it. But 1Password has historically been a great example of a well-designed Mac-native app, so I understand the disappointment.
  25. Like
    deanishe got a reaction from godbout in Is Alfred ready for 1Password 8?   
    For making their own lives easier, not for making a better application.
     
    They could have used Qt. They could have used each platform's native webstack. Instead they went with everyone's least favourite bloatware, Electron.
     
    Any developer who picks Electron is doing it for their own benefit, not their users’.
×
×
  • Create New...