Code Monkey home page Code Monkey logo

script-commands's People

Contributors

astrit avatar boyangmichael avatar crstauf avatar dehesa avatar es183923 avatar exodusanto avatar fe9lix avatar fsipiano avatar gleich avatar gniting avatar grzegorzkrukowski avatar imthath-m avatar itsnwa avatar jaklan avatar jesse-c avatar jonohewitt avatar jordicl avatar pitnikola avatar psalant726 avatar qeude avatar raffeyang avatar raycastbot avatar rolandleth avatar rso avatar tanguyls avatar thesulaj avatar thomaspaulmann avatar traynham avatar unnamedd avatar ybbond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

script-commands's Issues

After running a command, next launch should show initial screen

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

Gitlab scripts not working missing python

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?

Disable Toast

How to disable this toast? I tried the silent mode.

CleanShot 2020-12-29 at 18 15 02@2x

Unable to see my pull requests (or any repositories)

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.

image

Happy to help with whatever details you need

7 script-commands can't be found

7 script-commands can't be found now, they are scripts under folder system.

What happened

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.

bug

And I tried to reload the script directories, re-add the script directories, even restart macOS system and relaunch Raycast, it never work

bug01

I don't do any changes about my code and I think the others too.

Other information

  • Raycast version: 1.10.0

  • macOS version: macOS Big Sur 11.2.3 (20D91)

The missing script-commands

https://github.com/raycast/script-commands/blob/master/commands/system/audio-output-switch.template.applescript

https://github.com/raycast/script-commands/blob/master/commands/system/bluetooth.template.applescript

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/toggle-flip-screen.template.applescript

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

Linux support

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.

Custom parameters are not working correctly.

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:

  1. 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?

  2. 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.

Remove from Favorites

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.

open path of currently selected file in iterm

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.

Colored output

For scripts that show output, having color codes work would be good:

echo -e "Hola \033[91mseñor\033[0m"

should produce
image

but currently results in
image

Hope add clipboard automation!

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! ! !

Multilingualism planned?

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!

AppleScript Command Runs Slowly

I'm using this AppleScript to toggle an application's visibility:

Script
#!/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)?

Table mode

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.

Can't type/search in Raycast's on-screen input

How to reproduce?

  1. Hit the Raycast shortcut
  2. Type in the input

Actual behaviour

Input does not work

Expected behaviour

Input should work

Context

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.

Missing error messages for command scripts when missing dependencies

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:

Screenshot 2020-11-28 at 13 20 55

Steps to reproduce:

  1. Install https://github.com/raycast/script-commands/blob/master/commands/developer-utils/generate-password.sh command
  2. Make sure gpg is not installed
  3. Execute generate password command
  4. See Raycast crashing without any information for user
  5. Launch Raycast again to see Script failed to run information that disappears after a while

Expected behaviour

  1. When executing 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.

Proposal: make packageName required meta

If packageName was a required meta key, that allows for (at least) a couple things:

  • increased portability of the script command (a user can cherry pick scripts outside of directories and not lose any context info)
  • turn off entire packages rather than (or in addition to) individual scripts

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.

Access to more advanced UI elements?

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.

Add support for running Python 3 scripts

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

Open vim with script commands

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.

Issue parsing specific text combinations from script

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:
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.

custom message for needsConfirmation

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.

node: command not found

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

raycast can't open automatically at login

I tried so many times, it can't open automatically at login.

Configure

on macOS

raycast001

on Raycast

raycast002

How to reproduce

  • Configure raycast as above

  • Restart your Mac, you will find it.

More information

  • Raycast version: 1.10.0

  • macOS version: macOS Big Sur 11.2.3 (20D91)

Search contacts possible?

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?

Calculator full number

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

imessage-2fa regular expressions do not support Google 2FA

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:

Set up environmental variables

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

something wrong when print json.dumps result with ensure_ascii=False

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":"你好"}

Output in iTerm2:
image

Output in Raycast with ensure_ascii=False
image

Output in Raycast with ensure_ascii=True
image

Some system script-commands to not appear in the settings

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.

Extract URL title

Can it be enhanced to extract the URL title as an option?
so the output can include both

<title> + Thanks !

Accept arguments

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.:

  • I'd like to search npmjs.com for a module
  • I'd like to create a script called npm that I run like so: npm lodash - which opens url: https://www.npmjs.com/search?q=lodash

Current problems:

  • typing script title and something else - just shows File, google & duckduckgo searches.

Alternatively - you could allow custom searchers (so e.g. npm, stackoverflow, github could be added), but the former would give users more power :-)

Installation error on a user account without admin rights

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"}})

Applescript with emoji icon fail to run

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.

Apple Music "Current Track" doesn't work with streaming

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.

  1. When music is playing, "Current Track" just shows a Refreshed! snackbar and that's it. Is the snackbar supposed to show what is currently playing?
  2. If I do a "Stop" and then a "Play" nothing happens. Maybe "Play" only works after a "Pause"?

UPDATE

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

sed regex option (-r or -E) not supported properly

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 Terminal

echo "123   456" | sed -r 's/\s+//'

Screen Shot 2021-03-08 at 11 52 55 PM

sed -r in Raycast

echo "123   456" | sed -r 's/\s+//'

Screen Shot 2021-03-08 at 11 50 06 PM

sed with normal regexp in Raycast

echo "123   456" | sed 's/   //'

Screen Shot 2021-03-08 at 11 52 09 PM

pbpaste output handling and problem with unicode

I've faced problem with unicode on https://ray.so that it was not correctly decoded and looks like this.

Screenshot 2021-02-18 at 13 21 31

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/ // 🧐

Screenshot 2021-02-21 at 20 18 33

And final example:

("кек" is in pasteboard)

echo $(pbpaste)

🧐🧐🧐
Screenshot 2021-02-21 at 20 20 21

So I don't really know what a problem here, but I guess that it's something with internal handling of pbpaste command output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.