Jump to content

winterflags

Member
  • Posts

    22
  • Joined

  • Last visited

Recent Profile Visitors

1,408 profile views

winterflags's Achievements

Member

Member (4/5)

1

Reputation

  1. Given: //a[contains(@href, "UPPERCASE")][contains(@href, ".pdf")] the script appears to insert backslash characters (\) on four locations below: //a[contains\(@href, "uppercase"\)][contains\(@href, ".pdf"\)] Any way to fix this?
  2. I've set up a simple Hotkey-triggered NSAppleScript that will keystroke the query currently in the clipboard: on alfred_script(q) tell application "System Events" keystroke q end tell end alfred_script My question is, what if I use this to keystroke passwords? Can I do it securely? Obviously there is a clipboard history that needs to be disabled. Are there also Alfred logs somewhere that keep the results of the workflow/applescript? Does it matter if the script uses the "compile" settings or not? Thanks!
  3. Bump. (Hope that's okay). Does anyone know if Alfred Remote can initiate workflows on the computer, if it's locked or sleeping?
  4. Thanks a lot! Got it to work by assigning hotkey and binding it to a Run NSAppleScript with these contents: on alfred_script(q) set myName to computer name of (system info) if myName = "Computer-A" then tell application "Alfred 3" to search end if end alfred_script
  5. Thanks for that dfay, that should work nicely. I tried assigning an Alfred Hotkey to SHIFT + ALT + SPACE, and then tried to bind it to Run NSAppleScript and alternatively Run Script, can't get it to work however. Should this script be functional? set theComp to computer name of (system info) if theComp = "Computer-A" then tell application "System Events" to keystroke "space" using {option down} else if theComp = "Computer-B" then return end if I also tried to prepend/append: on alfred_script(q) end alfred_script … which didn't do anything. FYI, I got computer name via scutil --get ComputerName
  6. Is there some way to exclude a certain workflow from syncing between my two computers running Alfred? I'm using Dropbox to sync Alfred. The reason is that when I access computer A from computer B via screen sharing, pressing ALT + SPACE will Show Alfred on computer B, and not computer A. So I've set up an alternative Hotkey to Show Alfred. But now I need to be able to only use it on computer A, and not computer B. Thanks!
  7. Perfect – it works. Alfred is such a great tool. Thanks!
  8. Hello everyone! I've started working on an Alfred workflow that's supposed to take a Finder item, and search for its filename on the web (preferably on a specific site using Google). My thought was to use the File Filter to select the file in Finder, and then use the Action menu to open my workflow. It should then just be a matter of passing the filename to Open URL along the pattern of: https://www.google.com/search?q={query}%20site%3Amyhomepage.com But how do I get the filename and create a query out of it? Is there an easy way to do this using Alfred's native tools, or is a Bash/AppleScript/etc solution necessary? Advanced: What if I want to add some conditional rules, like removal of substrings or extension from the filename? (I'm still happy with just the basic functionality though)… Thanks!
  9. Keen observation! That solved my problem, thanks. Funny coincidence that they were using the same key combination, so I changed the one used in Evernote.
  10. Edit: I realized that the thread topic is ambiguous. The problem I'm having is that including a certain AppleScript in my Alfred workflow makes the Alfred bar behave weird, refusing to go away. I've made a workflow that uses a List Filter to open a set of URLs depending on the argument provided. I also included an AppleScript that tells Evernote to open a certain notebook/stack. The script is visible as the /usr/bin/osascript in the image below. When I run the workflow with the AppleScript attached to it, the Alfred Input Window closes but then displays again – with the previous input still there. It behaves very erratically each time, sometimes "blinking" on/off in perpetuity, which seems to be impossible to stop, except by rebooting the computer. When I run the workflow without the Applescript attached, the Alfred Input Window closes normally. Something seems to force the Alfred window to remain open. Is it a bug in Alfred, or something with the AppleScript and how it's implemented in the workflow? Note that I didn't write the AppleScript myself, but it was retrieved from the forum link above. I understand that this isn't the proper forum for AppleScript support – but is Alfred behaving in an unexpected way here? Thanks for any help! on run argv set destination to "stack:Communications" tell application "System Events" -- Let's make sure Evernote is running. If Evernote needs to be started, wait a sec! if not (exists process "Evernote") then tell application "Evernote" to activate delay (3) end if -- Now let's invoke a collection window by starting a global search. keystroke space using {option down} delay (0.5) end tell -- Sometimes it needs a moment for a collection window to be created. -- As long as no collection window exists, trying to change its query string will result in an error. -- We'll simply try again until we succeed. repeat set tryagain to true try tell application "Evernote" set query string of window 1 to destination end tell set tryagain to false on error tell application "System Events" keystroke space using {option down} end tell delay (1) set tryagain to true end try if not tryagain then exit repeat end repeat end run
  11. Can Alfred Remote sleep/shutdown a computer, even if it is locked? (Or indeed perform other actions, even if the computer is locked). The reason I'm wondering is because OS X has a Wake-on-LAN function that wakes my iMac whenever I open my MacBook, disconnect or connect my iPhone to power. I have my iMac in my bedroom, and it's pretty annoying that the iMac wakes when I plug my phone in for charging over the night. So if I could make Alfred Remote force the iMac to sleep, without having to get up and type in the password to my iMac, it would be great.
  12. Thanks for supplying the demo! It did what I wanted to achieve.
  13. Hi @deanishe, thanks for your help! I'm not sure if I'm quite getting how to do this in practice. Also, I'm not sure how to get the echo to work with the whole Terminal Command (it also does other stuff). I've added some images just to make it more clear what I'm attempting: Terminal Command: (The last image is obviously not going to work with the echo, as it stands).
  14. Based on a File Filter, I want to go to two locations with Terminal, within the same Workflow. Let's say the file filter path result is: ~/my/folder. The first part of the workflow will simply go to cd {query} which navigates to ~/my/folder. In the next part of the workflow, I want to keep the last part of the query – "folder" – i.e. the "Display Name" in the File Filter, and interject it in the path ~/my/other/folder. I guess there might be multiple ways to achieve this, and the way I've been trying to figure out has been to modify the query via string replacements, so that ~/my/ becomes ~/my/other/ I have also tried to understand upstream variables and if it's possible to get the "Display Name" in the File Filter and simply take that variable and paste it into the path ~/my/other/ so that it becomes ~/my/other/{var} i.e. ~/my/other/folder, but I haven't succeeded. Appreciate any help with this since I've spent almost an hour now with no results!
  15. Okay, I actually solved this myself within a few minutes after posting the question, d'oh. What you do, is add a Terminal command. And type in cd {query}. To make it work with path names that have whitespace in them (space bar), mark the checkbox Escaping: Spaces.
×
×
  • Create New...