raycast / script-commands Goto Github PK
View Code? Open in Web Editor NEWScript Commands let you tailor Raycast to your needs. Think of them as little productivity boosts throughout your day.
Home Page: https://raycast.com
License: MIT License
Script Commands let you tailor Raycast to your needs. Think of them as little productivity boosts throughout your day.
Home Page: https://raycast.com
License: MIT License
Is is just me or does the brew install
command not work at all?
I suspect the braces around the parameter are the culprit.
Example
Launch raycast
type myschedule
hit enter
choose an event
hit enter to open it
raycast is closed and action is done
Launch raycast for completely different purpose
screen is still on calendar view with selected calendar event as before
now the user has to tap esc twice in order to go back to screen one where he can search for another action to perform
I have installed the speedtest cli from the website using brew, and after reloading it still states that I do not have it installed, but I can run the speedtest command in terminal
Is there a way to edit the default search provider?
Specifically, I want to remove google web search (and ideally move duckduckgo up).
Thanks for providing such a good software, it is recommended to provide some conventional operation commands.
E.g. empty trash
, Lock Screen
, Restart
and more.
I am trying out the Gitlab script commands and I have populated gitconfig.py
with the personal access token and removed .template
from the files but when select the command in Raycast I am getting:
Traceback (most recent call last):
File "/Users/weyert/Development/Raycast/script-commands/commands/developer-utils/gitlab/gitlab-todos.py", line 36, in <module>
from gitlabhelper import GitLab
File "/Users/weyert/Development/Raycast/script-commands/commands/developer-utils/gitlab/gitlabhelper.py", line 4, in <module>
import certifi
ModuleNotFoundError: No module named 'certifi'
Where do I need to install certifi
?
Hello, I just discovered your product. Works great for jira, thanks a lot!
Reporting a bug or maybe misconfiguration hazard for github. I connected with my account which is part of a private organization. However, I can't see my pull requests or repositories.
Happy to help with whatever details you need
7 script-commands can't be found now, they are scripts under folder system
.
Considering Open Folder
was submitted by me, I will use it for further explanation.
When I use this script, it should be like this
but now it has gone.
And I tried to reload the script directories, re-add the script directories, even restart macOS system and relaunch Raycast, it never work
I don't do any changes about my code and I think the others too.
Raycast version: 1.10.0
macOS version: macOS Big Sur 11.2.3 (20D91)
https://github.com/raycast/script-commands/blob/master/commands/system/open-folder.sh
https://github.com/raycast/script-commands/blob/master/commands/system/toggle-airpods.template.swift
https://github.com/raycast/script-commands/blob/master/commands/system/vpn/vpn-start.sh
https://github.com/raycast/script-commands/blob/master/commands/system/wifi.template.applescript
Obviously, having this on Linux would be just the most amazing tool in its category.
It looks like it is 100% macOS only but Github show it has most of the code is Swift code and Swift is now open source so maybe that make supporting Linux an option? 🙏
Anyways, great tool guys, really awesome.
Using below scripts:
#!/bin/bash
# Raycast Script Command Template
#
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Launch V2
# @raycast.mode silent
# Optional parameters:
# @raycast.packageName v2
# @raycast.argument1 { "type": "text", "placeholder": "mode" }
./startup.sh ${1}
Problems:
Above snippet was copied from the instruction page, but those optional parameters
are not optional
. I got a Value is missing in argument
popup when I leave the parameter blank. So how to specify an really optional
parameter?
Choose the script command, specify the parameter, hit enter, it works like a charm. But next time if I use hotkey to call Raycast out again, the script command I used before is automatically selected and the parameter filed gets the focus even I don't want to use the script command again. I cannot navigate to whatever I want as I need to get the cursor out of the parameter field first, either by using cursor clicking or use tab.
EXPECTED:
Everything should be cleared ever time when Raycast gets called out.
I just installed Raycast for the first time, an excellent app, good work.
It's just a UX suggestion.
I tried to remove Jira from the list and unchecked it from the extension interface, no effect.
So I was looking for another way to dismiss it and discovered I need to click on "add to favorites", to remove it.
It would be more intuitive if the button change to "remove from favorites" when something was already in add in the favorites.
Launchbar has a very useful feature where you can long hold CTRL Space and then it will copy the selected file as the launcher argument, when you then type "iTerm" it will launch the currently selected file in iterm. If the file is not executable it will simply open iterm in the containing folder.
It would be very handy to have something similar in RayCast.
the default Google Search and DuckDuckGo Search can't be disabled.
Raycast is so great!
I hope there could be more functions for clipboard history, such as clipboard trigger, which can trigger scripts or shell bash when specified words were mentioned in clipboard, it can possibly enhanced the script ability, and also provide a element method to connect iOS devices and Mac, Thanks! ! !
At first I want to say thanks for this awesome Spotlight search replacement, it works like a charm. Are there any plans to support multilingualism in the near future? I could help to contribute some translations for german if needed.
Thanks!
I'm using this AppleScript to toggle an application's visibility:
#!/usr/bin/osascript # Required parameters: # @raycast.schemaVersion 1 # @raycast.title Toggle Visual Studio Code # @raycast.mode compact # # Documentation: # @raycast.description Toggle Visual Studio Code App # @raycast.author paco # @raycast.authorURL paco.sh set appName to "Visual Studio Code" set startIt to false tell application "System Events" if not (exists process appName) then set startIt to true else if frontmost of process appName then set visible of process appName to false else set frontmost of process appName to true end if end tell if startIt then tell application appName to activate end if
But sometimes it takes upwards of 5 seconds to run! Is this an issue with my script or Raycast? Why is it so slow? Are there plans to add this functionality to Raycast natively (like Alfred has it as a built-in workflow action)?
I am running scripts that I currently pretty-print using column
. This works fine, but looking at other Raycast integrations I think it would be great if you could support outputting via scripts into a table view.
I can imagine printing into stdout in a CSV format, which Raycast then shows as a native table.
When I run that command, it runs for a while before popping out an error:
The full error can be seen when running the script via terminal:
./bluetooth-toggle.applescript:492:537: execution error: System Events got an error: Can’t get process "ControlCenter". (-1728)
MacOS 10.15.7 (19H114)
Tagging @vincentdoerig <3
Input does not work
Input should work
I've just installed Raycast, and enabled some extensions and added scripts. Typing does not work even after disabling all the extensions.
Raycast did not ask for any permissions.
I found out that error handling for some commands that may miss dependencies or fail due to wrong parameters, like gpg
, pa11y
, shorten-url
is not working properly.
Instead of showing error message that is desired and defined in script, Raycast is closing itself, crashing.
After reopening Raycast again there is "Script failed to run"
information being shown at the very bottom.
Please find screenshot attached:
Steps to reproduce:
gpg
is not installedgenerate password command
Script failed to run
information that disappears after a whileExpected behaviour
generate password
command without gpg
there should be readable message shown for a user, which is already part of the script, but now shown properly: "gpg command is required (https://www.gnupg.org/)."
Fix
When using exit 0
instead of exit 1
things are getting back to normal.
Guidelines https://github.com/raycast/script-commands/blob/master/CONTRIBUTING.md are also suggesting to use exit 1
in scripts - so I think that Raycast needs to handle it properly.
I originally tried to fix it with if/else
or exit 0
approach and created a PR for that to fix scripts - but after going deeper into Guidelines I am sure it has to be fixed inside Raycast code to be in line with Guidelines.
If packageName
was a required meta key, that allows for (at least) a couple things:
While portability is important, I see the ability to turn off entire packages to be a critical step. For example, I use Cloudup as my screenshot sharing service, but there are plenty of other services that do that. A user of another service won't need Cloudup, and so would need to search the entire list for Cloudup scripts, or delete the files from their directory each time they update the scripts from this repository. If Raycast supported toggling entire packages, that'd be a one time change, and done.
I expect there are additional advantages to requiring packageName
, whether now or in the future.
Haven't found this anywhere - how I would I go about adding a custom script that renders more advanced UI elements?
One example being the filter + list of the github application.
Being able to run arbitrary python 3 scripts would greatly enhance the number of things I can automate with Raycast.
I was thinking you could specify which python 3 binary should be used with a
#/path/to/python/
At the top of the script file
Hi there,
I have a workflow for note taking, where I have two scripts - note
and edit-note
, which open (neo)vim, and then commit any changes to my git repository. It seems like using script commands in raycast does not support it, with vim complaining it is not running in a terminal.
Have you thought in general how workflows like this could be supported? I understand it's probably hard to get this to work right, but wanted to voice that I definitely would love to have that integrated into Raycast.
I noticed that when I copy this example code:
<?php
sprintf("Hello <fg=yellow>%s</>", "world");
And then run the script create-image-from-code.sh
It ends up making this as the image:
And in this state, the "Download image" doesn't work.
I managed to reduce it to the following code that will produce the issue:
<>%s
Note that the newline above the line with the >%s
is required to recreate the error.
I am on MacOS Catalina.
This has been mentioned in Slack a couple of times: creating this issue to track it.
I have a script that pulls information from an API - since there is no way of other interactive user input with scripts (and if I understood correctly, script commands will not have such functionality), I was wondering if there was a way to implement a custom confirmation prompt/message option so that the user can confirm a specific action.
For my specific use case:
My script pulls trello cards from a board, and based on the current time selects the closest card. I want to archive this ticket, but would like to confirm that the script picked the correct card.
Problem
I can't execute executable script.sh which uses node via Raycast. Running the same script from CLI ./script.sh works correctly.
Output
/Users/user/Documents/raycast-scripts/script.sh: line 11: line 11: node: command not found
Expected
node is in my $PATH so I can run scripts via Raycast the same way I run them from CLI.
*script.sh(
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Open Script
# @raycast.mode fullOutput
# Optional parameters:
# @raycast.packageName Applications
node script.js
script.js is also executable
I read the contributing guidelines, but there was nothing about how to request features. Is it OK if I place it here?
I would love to have my contacts searchable from Raycast - much like Spotlight does. Would that be a potential feature in your roadmap?
Hi guys,
first of all I want to thank you for great app.
Is there option how to get from calculator full number?
If I count this 496219,01 + 138172,17 I get 634,391k but full number is 634391.18
Thank you,
Jan
While the regex for the imessage-2fa
script identifies and isolates 2FA codes (large numbers) sufficiently for most services, it doesn't handle 2FA codes that are preceded with character, ex: Google (G-123456
).
The regex should be adjusted to keep current working functionality, and also identify and isolate 2FA codes from Google (and others) that precede the 2FA code with a single letter and dash (ex: G-
).
There are multiple regular expressions in use:
At the moment it isn't possible to set up custom environmental variables or load additional $PATH
to the shell that executes script commands.
While you can specify to run scripts as login-shell (e.g. #!/bin/bash -l
), this harms portability, usability and performance of script commands. It can also leak unrelated information into Raycast, which we want to avoid.
As agreed in our guidelines, we won't allow script commands that run in the login-shell in this repository. You can still use this option for your own setup. Instead, we will add preferences to allow injecting specific information, e.g. the PATH
to your global node modules directory.
This is issue acts as reference for the additional preferences to set up environmental variables.
—
Created via Raycast
Is it possible to write a script like nodemon
or pm2
to create a better development environment, which tracks running processes, and where logs can be directly accessed via the raycast by search?
Script editor tells me that it is expecting an "End of Line but is finding a quotation mark" not sure what that means as I copy and pasted directly from GitHub 😅
I uploaded it to imugur to be more clear.
Thank you for any help!
script command:
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Prettify JSON
# @raycast.mode fullOutput
# @raycast.packageName Developer Utilities
# Optional parameters:
# @raycast.icon 💻
# Documentation:
# @raycast.description Pretty prints the JSON currently in the clipboard.
pbpaste | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(json.dumps(obj,indent=2,ensure_ascii=False))'
Input json string
{"text":"你好"}
@mrmartineau Is there any issue with using the icon used for the "Save to Wayback Machine" script for the "Wayback Machine search" script's icon as well?
Hi,
thanks a lot for Raycast. It's incredible and I can't wait where you take it.
I recently noticed that there is a audio-output-switch.template
which I'd love to use. I also saw it has the title
Switch Audio to <>
. However when adding the system script-commands
to the Raycast settings I can't spot this command. Same for the Bluetooth command.
Is there any trick to have it appear there?
Thanks.
Can it be enhanced to extract the URL title as an option?
so the output can include both
It seems that the toolkit looks at only the subdirectory name and completely disregards the packageName
meta value. This is demonstrated on the emoji scripts, which have the packageName
set as Communication
, yet are classified as Emoji
in the auto-generated documentation. This differs from Raycast behavior (emoji scripts shown as "Communication), and I believe is a bug or oversight.
Thanks for this amazing app!
It's the best thing that happened to my mac since Alfred (10 years ago)!
It would be fantastic if a script could accept arguments, e.g.:
npm
that I run like so: npm lodash
- which opens url: https://www.npmjs.com/search?q=lodash
Current problems:
Alternatively - you could allow custom searchers (so e.g. npm, stackoverflow, github could be added), but the former would give users more power :-)
If you try to update the software with the command "Check update" directly from the software and you have a user account, this is not possible.
Stack trace:
Optional(Error Domain=NSCocoaErrorDomain Code=513 "“Raycast” couldn’t be moved because you don’t have permission to access “Applications”." UserInfo={NSSourceFilePathErrorKey=/Applications/Raycast.app, NSUserStringVariant=( Move ), NSDestinationFilePath=/Applications/Raycast (544).app, NSFilePath=/Applications/Raycast.app, NSUnderlyingError=0x600003ef00f0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}})
Hi,
first of all I want to say that I love what you are doing with Raycast. I'm tweaking it a bit with script and I have bumbed to tricky issue. When I try to run applescript in Raycast to which contains emoji icon it won't run if there is a tell
block over multiple lines.
I have tried sleep command from this repo and it worked fine. But when I tried to run toggle-desktop-icons
it failed and nothing happen. I have tried to change mode to compact
and it write Operaction couldn't be completed. Exec format error.
. But if I delete # @raycast.icon
line script works.
macOS version 10.15.7
Tested it with Raycast 1.1.0 and 1.1.1.
I've installed the Apple Music scripts on 2 2019 MacBook Pro's 15" with Big Sur 11.2, and don't know if these are issues or just the way they work.
After some debugging with @unnamedd we found the problem with # 1 above is it only works with local songs. If you stream a song you get "Not playing". What happens is these two lines throw an error:
set currentTrackName to name of the current track
set currentTrackArtist to artist of the current track
Labels
help wanted
Hello, I found that the regex option (-r
or -E
) of sed
does not work in the raycast terminal, but normal regexp works. Please check the following screenshots. Any idea what the problem is? Thanks in advance.
FYI, in case this is related to terminal type, the $TERM
for my terminal is xterm-256color
and that for the Raycast script is linux
.
sed -r
in Terminalecho "123 456" | sed -r 's/\s+//'
sed -r
in Raycastecho "123 456" | sed -r 's/\s+//'
sed
with normal regexp in Raycastecho "123 456" | sed 's/ //'
I've faced problem with unicode on https://ray.so that it was not correctly decoded and looks like this.
So I start digging and find out that for some reason in Raycast script reading from pasteboard with pbpaste
is not working correctly
I've modified original create-image-from-code.sh
to fullOutput
to print results and what I've got
Examples:
CODE="кек"
echo $CODE | base64
Output: 0LrQtdC6Cg==
// correct
Now same but from pbpaste
("кек" is in pasteboard)
echo $(pbpaste | base64)
Output: Pz8/
// 🧐
And final example:
("кек" is in pasteboard)
echo $(pbpaste)
So I don't really know what a problem here, but I guess that it's something with internal handling of pbpaste
command output.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.