Jump to content

Search the Community

Showing results for tags 'osascript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Alfred 3
  • Make the Most of Alfred
    • Discussion & Help
    • Bug Reports
    • Alfred Feature Suggestions
    • Themes
  • Alfred Workflows
    • Share your Workflows
    • Workflow Help & Questions
    • Advanced Tips & Tricks
  • Alfred Themes
  • Alfred Remote for iOS
    • Alfred Remote Discussion & Help
    • Remote Connection Troubleshooting
  • Alfred 5 Early Access
    • Alfred 5 Early Access


  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Website URL




Found 9 results

  1. If you run the command shown in the picture as Alfred, the osascript -e 'tell app "System Events" to restart' command won't work. Is there any way to solve this problem? Thank you in advance 🙏
  2. I am trying to build a custom URL builder for a bunch of my work URL. I have the following script but it seems that open URL is not detecting the URL. For open URL I put `{query}`. What am I missing? function run(argv) { var appType = argv[0]; var theEnv = argv[1]; var url = 'https://www.google.com'; return url; } What am I missing? The URL it opens is `https://www.google.com%0a`
  3. The Run Script action, particularly relevant to osascript, appears to return the result of the script as text that is terminated with a line break character. This causes problems when the script returns a file path, which gets fed into the subsequent node of the workflow that is expecting to receive a file path that points to an existing file, but instead receives a file path that points to a non-existent file because of the extra character in its name. https://transfer.sh/LEmG3/Bug Report.alfredworkflow The workflow demonstrates the phenomenon. It simply displays an osascript output surrounded by quotes to visualise the string in its entirety. The code used in the `osascript` is: on run return "~/Downloads" end run This might not technically be a bug, per se, as I'm guessing the Run Script actions all execute a script by way of a shell command, and therefore it may be that the osascript command itself is returning this output rather than something Alfred is doing. That said, when I run the following command in Terminal: osascript -e 'return "~/Downloads"' | wc -l it reports that the output does only contain a single line.
  4. I'm running a simple Alfred 3 workflow as I always have but the osascript portion of it is failing all the sudden. I've restarted my machine and of course Alfred 3. This is the error I get: [ERROR: action.script] osascript: no such component "JavaScript". I'm on OSX 10.12.5 Please advise, John
  5. Hello, my workflow starts by opening my VPN, however when my VPN launches a popup asks for the administrators password saying 'osascript wants to make changes enter your password to allow this. I would like to know if anyone else has found a solution for this because it's stoping my workflow. Anyone know if it is possible to add the password input to the workflow or disable this prompt or maybe over come it with a script or maybe a setting in apple or something? Does anyone else have this prompt when starting a vpn?
  6. I'm trying create a workflow to utilize the MacOS Say command. With this command, I'd like to queue up several paragraphs for it to speak and highlight the spoken paragraph. I'm close, but I'm running into issue with the clipboard management. It was my understanding that the /bin/bash scripts can queue commands up in sequence. In which case the below code should execute like this; 1. Copy the query (which in my workflow is the selected text). 2. Open find in Safari 3. Paste the clipboard contents. 4. Say the selected text. It looks like the LAST copied text ends up being pasted, instead of in sequence. The say command adheres to the sequence properly. The other commands do not, what am I missing? screenshot of the workflow is attached. pbcopy < "{query}" osascript -e 'tell application "System Events" to keystroke "f" using command down' osascript -e 'tell application "System Events" to keystroke "v" using command down' say "{query}" -r 250
  7. A simple Alfred workflow using osascript shell scripts to implement keyboard and mouse control in Apple’s “Help Viewer”. “Help Viewer” does not seem to want to do so natively, so this is a bit of a hack. Download. Github. BetterTouchTool Mouse Control is achieved through BetterTouchTool. “Help Viewer” never actually takes focus, so the shortcuts and settings must be enabled universally. Thus the out-of-the-way keyboard shortcuts bound to mouse buttons. Application-specific settings will override them: Further Development This workflow was created on 10.9.5 for Alfred 2.6 (374). I don’t plan to upgrade to Yosemite anytime soon, so I will keep it functional for Mavericks and Alfred updates. If you would like to adapt it for other versions, please do. If anyone knows how to get “Help Viewer” to respond directly to Applescript run by Keyboard Maestro or BetterTouchTool, that would be a much more straightforward method. I kept getting “posix_spawn: error 7” though.
  8. Here is a simple workflow to create a text file with clipboard content in the current or top most Finder window/folder: 1. using a hotkey: the text is created with the following filename pattern: Clipboard - yyymmdd(hhmmss).txt 2. you can use newf key in Alfred (see screenshot) so you can write the first part of the file name (use CTRL key to remove the date and time from the filename). The default date and time was code this way in order to always generate an unique filename. Screenshot: http://d.pr/i/A2Kv Download: http://d.pr/f/5Jp7 This workflow is more a sample on how to use Shell/Bash and AppleScript together. Credits to phyllisstein and his workflow* and David Ferguson for helping. * http://www.alfredforum.com/topic/394-fixed-create-a-new-file-in-the-finder/
  9. Hi, I have a simple test workflow consisting of a Keyword box which triggers a /bin/bash Run Script box. The script inside the box is 1 line:- echo "some text" Feeding this into a Post Notification box works as expected, but when I feed it into a /usr/bin/osascript Run Script box which contains the following:- set temp to "{query}" set the clipboard to temp nothing gets written to the clipboard. Changing 'set the clipboard to "more text"' doesn't work either until I delete the first line 'set temp to "{query}"'. Is it a bug?
  • Create New...