Jump to content

GuiB

Member
  • Content Count

    284
  • Joined

  • Last visited

  • Days Won

    17

GuiB last won the day on December 7 2019

GuiB had the most liked content!

3 Followers

About GuiB

  • Rank
    Advanced Member

Profile Information

  • Location
    Canada

Recent Profile Visitors

1,967 profile views
  1. Actually, you don't need to edit that line. The `filePath` string that is mentioned here is simply a variable that refers to the `filePath` string from the first line. I mean, the first line is simply there to set a variable to the file path that you want and then this variable is used later in the script. I put it there at the top so it is easy to see and make it clearer. Hope this helps!
  2. @Nabil, for the script, you need to change the `"/path/to/your/image"` in the line: set filePath to "/path/to/your/image" to the path of your file. You can get the file path using the Alfred File Action named "Copy Path to Clipboard" or the 'Copy "fileName" as Pathname' that you can get while doing a secondary click on the file in the Finder and holding the Alt key (like explained here: https://osxdaily.com/2015/11/05/copy-file-path-name-text-mac-os-x-finder/ )
  3. Hey, a little late, but wanted to join the party since this is one of my most wanted feature requests (I think we talked about this multiple time ago...)! Actually, it would be great to remove the restriction completely and allow to assign the same hotkey in any workflow and make a popup to list the possible list of actions when invoking a hotkey which is assigned to multiple actions (like @Jasondm007 is mentioning), but being able to use the same hotkey only in app-specific situation would be a great step! I've been assigning some of my hotkeys from behind (by editing the workflow "info.plist") or using BetterTouchTool or Hammerspoon to get around this. I think the idea to pop a list of the actions that are linked to the invoked hotkey would make it work and would clearly show that we have a conflict, but the wanted action could still be invoked from the popup list. Maybe to make it even clearer, you could add a little mention on the popup that specifies that multiple actions were found using the invoked hotkey... For the popup, what I'm thinking is to just pop the normal Alfred search UI, but with the list items set to the conflicted actions (so we can invoke one using CMD+1 or CMD+2 ... or writing its title to filter the list). The problem I'm thinking is how can we get a title, but the Hotkey object doesn't have one... maybe you could use the Workflow Title and with that, maybe you could add a "Label" field to the Hotkey object or use an Object Note as title? With that you could set the item icon to the Workflow icon or add an icon field to the Hotkey object... Maybe those new fields could be grouped and mention that they would be used in case of hotkey conflict. I know this may be quite some work to implement the feature, but I think this would be worth it and I think it would actually make it less confusing to every user (new and more experimented ones; I think there were multiple messages here on the forum regarding the confusion of a user regarding why it couldn't use a specific key combination and then later found out it was already used somewhere else). Also, this could be used to implement some kind of modal keybinding. To give some more idea... To make it easier to fix those conflicted hotkeys, when on this popup you could set a modifier key that would jump to the selected hotkey object node in its workflow. This way we won't have to search too much to find where it was set. So again, just my +1
  4. @Jasondm007, yes that would be great to be able to call directly the File Action, but at the moment I think the only way is doing GUI scripting using AppleScript like @deanishe said or you can implement your own version of the built-in actions using a shell script or AppleScript. For the Open With, if you want to avoid the GUI scripting route, you can easily do it using a shell script like: open -a "ApplicationName" /Path/To/File
  5. @Jasondm007 honestly I don't have many tricks for trying to get some outputs to the debugger and carefully looking at the information there. Sometimes I look at what is happening before, sometimes after a node, trying to output a variable and analyzing it to see if it's right, adding tests inside the script to try to pinpoint where the problem occurs (see if a loop is looping correctly, if a variable is set correctly...)... In this case, you could see that from the "imc" Keyword node a string was output with paths separated by tab, but on the "Image..." File Action node you could see that the paths are separated by "comma" in the debugger (if you connect the Debug node just after the File Action). This way you have a little cue that the outputs are different. Then you can inspect the "item 1 of argv" and see if they match and if not try to find out why they are different. With that said, keep in mind that from an Alfred node that output a list of items you would get a List, but when chaining multiple nodes (different Run Scripts or other actions) one output is passed to the next node as one string. So, in order to get multiple items we have to build this string we can manipulate it in the next node to retrieve the different items (that's why I'm passing the paths with tabs as separators as a trick to pass multiple items so we can easily split them afterward in the next node). You can use any delimiter that you want of passing JSON string or something else (like we talked on this thread: To get back to your workflow above, actually you don't have to pass the output of your AppleScript from your "imc" keyword node and depending on what you want to achieve it could be easier to directly loop over the selection list that you get from the Finder instead of modifying the list to a single string with tab delimiter (especially if you want to connect it to another AppleScript). Here is a modified workflow to show you how it looks if you use the selection directly: https://d.pr/f/pvtilq Also, I don't remember exactly why I added the Trim function to make sure to trim the files path (maybe to make sure one of the paths doesn't have an extra whitespace in it in case we output as one string), but if you use the passed list from Alfred file action or the Finder selection, then you shouldn't have to trim the paths. Hope this helps a bit! Best
  6. @Jasondm007, you problem is that when you are directly connecting to the File Action you are receiving a list of files in "argv", but on the second example ("imc") you are sending a tab delimited list of file paths that consist as a single string as input. Therefore, on your first example you can iterate over the list input of you script and not just the first argument ("argv 1"). Here is a modified version: https://d.pr/f/0BOBGT I added a delay to better make sure the item has time to be copied (I didn't have all the items on my clipboard viewer if not), but you can play with it to make it work for your case.
  7. @KA_, you can use a "Random" node that outputs a number in the range of 1 to the number of URLs that you have and then you use a "Conditional" node to select the "Open URL" node that is linked to the selected random number. Here is an example: https://d.pr/f/yKRv5w
  8. @cebroski in addition to what @deanishe said, I would recommand to remove also the last part of the scipt so it doesn't close an already opened tab. I mean, remove: -- close the first default tab tell application "System Events" keystroke tab using control down delay 0.2 keystroke "w" using command down end tell However, if I understand well what you want, I think it would be better/easier/faster to use the Alfred's builtin 'Open URL' object. The idea is to have a Keyword object (or another trigger) that connect to 2 'Open URL' objects that send your specific URLs to Firefox. Here is an example workflow that should do what you want: https://d.pr/f/jsvmIY Make sure to check the "Open links in tabs instead of new windows" in the Firefox Preferences.
  9. @slyfox, yes @deanishe is right about the first example whose passing the Arg & Vars to Alfred, but my second example uses Python. Here is the workflow updated again: https://d.pr/f/z8i7VM But to put it here in the forum: My first one uses an expression in the Arg & Vars (ex: `round(({query}+({query}/0.971))*100)/100` ) and pass it to Alfred using `tell application id "com.runningwithcrayons.Alfred" to search "={query}"` My second example uses a Script Filter set to the Python language and what is great is that you can see directly see the output. You can just change the expression at `val = round(query+(query/0.971),2)` to use what you want. Here is the script: import sys, json query = float(sys.argv[1]) val = round(query+(query/0.971),2) data = {'items': [{ 'title': val, 'subtitle': str(query)+'+('+str(query)+'/0.971)', 'arg': val, 'text' : { 'copy' : val, 'largetype' : val }, }]} sys.stdout.write(json.dumps(data))
  10. @Twice Bitten, since you are not mentioning which Terminal application you are using, I guess you use Terminal.app. So, to "pass the text into the current Temrinal session window" and keeping your default Terminal integration as it is in Alfred (so you can keep your other action to open a new Terminal Session if you want), you can create a workflow that pass your text to a Run Script object with the script language set to /usr/bin/osascript (AS) and with the script set to: on run argv tell application "Terminal" activate -- comment this line if you don't want to send the Terminal window to front do script (item 1 of argv) in tab 1 of window 1 end tell end run or if you want to change Alfred's Terminal integration as mentioned by @vitor and use ! , you can set Alfred to use a Custom terminal application and set the script to : on alfred_script(q) tell application "Terminal" activate -- comment this line if you don't want to send the Terminal window to front do script q in tab 1 of window 1 end tell end alfred_script
  11. @davidtesler I updated the workflow to strip any non-numeric characters from your query (should better work with different phone number format). I'm not sure if Ring Central does it by itself, but based on @raygan's post above it shouldn't and this should help. New workflow: https://d.pr/f/xmMuSE Best!
  12. Great, thanks! Really appreciated! I'm glad this was useful!
  13. @davidtesler I don't have Ring Central and never used it, but I made a workflow based on the above posts. Not sure if this will work, but this can give you a start Workflow: https://d.pr/f/LiaYHQ
  14. There's a preference to disable the sound in the Notification Settings at: The Bell Icon (top right corner) -> Notifications Settings -> Notification preferences -> Play a sound when I receive a notification @dfay , could this help to uncheck this?
×
×
  • Create New...