Git Product home page Git Product logo

boop's Introduction

Boop.

UI Screenshot

WebsiteDownload from GitHubGet on the Mac App Store
DocumentationFind more scripts

How to get Boop

There are four ways to get Boop. Your best bet is either to

You can also build it from source, or get it from Homebrew, although that is not officially supported.

How to build from source

If you're just trying to get Boop, building from source might not be your best bet. Developing new scripts does not require building from source.

  • Clone or download a copy of the repository
  • Open Boop/Boop.xcodeproj
  • Press play

Documentation

boop's People

Contributors

andipaetzold avatar armandsalle avatar awzhy0yqh81uoyvh avatar cdfmlr avatar codepo8 avatar dan2552 avatar daniel-stoneuk avatar dennis-menge avatar flare576 avatar ivanmathy avatar jnozzi avatar jnre avatar josefdolezal avatar jtolj avatar luisfontes19 avatar m0nhawk avatar m4rr avatar mmshivesh avatar ncke avatar nhalford avatar nhnicwaller avatar nntrn avatar papatangosierra avatar qaisjp avatar reichert621 avatar riesentoaster avatar sbesselsen avatar spoike avatar sunnywalker avatar xshoji 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

boop's Issues

Improve Newline Handling

Several existing scripts assume \n as the line break. I see two possible solutions:

1: We could include and use something like node-newline to avoid making assumptions about newlines.

2: Alternatively, we could enforce line normalization to \n when requesting the state's fullText / text / selection.

Feature request: Minify JSON

Hi! Awesome app! Please can you add minify json:

So the Boop could turn this

{
  "json": [
    "abc",
    "def"
  ]
}

into this

{"json":["abc","def"]}

For me, it's one of the reasons to open Sublime Text.

Pressing tab inserts spaces

I would like to have a way to:

  • choose if I want to insert a tab or spaces
  • configure the amount of spaces inserted
  • indent selection with tab/shift-tab

Of course I could write a script for that but basic editing before applying a script is imho necessary.

Support Math functions

The idea is to introduce the whole—or a subset—of Math object as specified by ECMAScript.

This would make it easier to access common Math functions such as random, sin, cos, floor and ceil and more.

One use case would be to randomly shuffle a list using Math.random:

function shuffleArray(array) {
  let tmp = [...array];

  for (let i = array.length - 1; i > 0; i--) {
    const j = Math.floor(Math.random() * (i + 1));
	tmp[i] = tmp[j];
    tmp[j] = tmp[i];
  }

  return tmp;
}

⌘+W doesn’t work

Pressing ⌘+W doesn’t work in both the main window and the Boop Preferences.

macOS 10.14.6 (18G5033)

Default Feature Request [Format SQL]

I would love to be able to format SQL dumps out of the box. I have to read queries from the terminal all the time and go to a site to format them.

Looking into making my own script.

Lack of commands in Menu Bar

This app should have menu bar commands which can help with discoverability. First thing I did when launched this cool little app is checked all menu bar options, I couldn't find anything like "Format JSON".

The command + B launcher is cool, but every Mac app should have all its features visible in Menu Bar.

Given that app is free, there's no any pressure.

Support UTF-8 character set

This Base64 encoded text:
4p2k77iP

should result in (Base64 decoded):
❤️

And vice versa.

Actual it results in
��

(I guess the ascii representation).

Support multiple scripts per file

With the new require function, it's a lot easier to have duplicate of large pieces of code. Adding support for multiple scripts in a single file means that functions that share code can also share the same javascript context, saving memory and making debugging easier.

Avoid adding too many quotes

When typing a quote next to an already existing quote, the editor gets a bit overzealous and adds two. Instead, we should check if the next character is a quote, and only add one if that's the case.

Copy text displayed in the status

A nicety would be to allow users to select text that is displayed in the status:

display area

The interaction could be clicking on the status which would then notify the user that the text as been copied to their clipboard.

Bug When Running Script on Full Text with Unicode

Running a script on full text (I mean, no selection) that contains Unicode chars with cause an unexpected result:

屏幕快照 2020-07-02 11.13.18

Emmm, this is exactly not an issue of Base64Encode script. Whit this text, Any script result with a funny U+DE00 char:

屏幕快照 2020-07-02 11.18.22

If we add more utf-16 chars into the text, it bombs (Some utf-16 chars are static here):

屏幕快照 2020-07-02 11.22.40

My version is 1.1.0 (3) from App Store

Crash when selecting action

  1. Open Boop
  2. Press Command+B
  3. Type J
  4. Hit Down Arrow
  5. Hit Enter

Boop crashes with the below:

*** Assertion failure in CGEventRef NSEventToCGEventRef(NSEvent *)(), /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1894.60.100/AppKit.subproj/NSEvent.m:2059

Printing description of exception->exception:
Unrecognized event type 0
(null)

Boop_2020-06-17-003441_Bretts-iMac.crash.txt

I couldn’t find much information around in terms of what could be causing this issue.
I can raise a Feedback with Apple if it looks like an issue with macOS, also just a note that I am running 10.15.6 Beta (19G46c).

UPDATE:
This is caused by

, returning the original event stops the crash.

Word Counter

Hi,

Thanks for the excellent app - such a great idea and has come in handy already. One small thing, though, there's a character counter and a line counter but no word counter!

If it helps and you would like to merge a word counter, I can work on one. Let me know.

Thanks

Make widow remember size on close

When opening the Boop it always have same fixed size, It would be fantastic if it remember the size and position on close so next time when opened it its in same size and position.

Make script loading lazy

As the script base grows, and with scripts potentially becoming heavier with the addition of modules, the script manager should be switched to only boot up a virtual machine when a script is actually being used.

Investigate whether JSContext uses more memory/CPU than keeping the whole script js as a string.

List of scripts

Hey, It would be nice to include a list of scripts that are available. At the moment it's tricky to know at a glance what things the app can do.

How to run Boop after installation?

I have run upto carthage bootstrap --cache-builds --platform macos in the README. How do I run Boop after this? Not sure how to open Boop/Boop.xcodeproj

Display Full List of Available Scripts

Having a way to see all the available scripts would make it a little more discoverable as a new user. I ended up typing random letters in the picker to see what's available.

Title Case

/**
    {
        "api":1,
        "name":"Titlecase",
        "description":"Converts to Titlecase",
        "author":"brokosz",
        "icon":"metamorphose",
        "tags":"titlecase,uppercase,capital,capitalize,capitalization"
    }
**/

String.prototype.toTitleCase = function () {
    return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
};

function main(input) {
    
    input.text = input.text.toTitleCase();
    
}

Lowercase string script

/**
	{
		"api": 1,
		"name": "Lowercase",
		"description": "Lowercase string characters",
		"author": "davidfmiller",
		"icon": "quote",
		"tags": "string"
	}
**/

function main(input) {
	input.text = input.text.toLowerCase()
}

Output JavaScript errors to Console log

It is currently difficult to debug scripts because errors are truncated in the "display" area and there is no way to see the full message:

Error is truncated in Boop

To make debugging a bit easier, it would be nice if Boop would output errors thrown by the JavaScriptCore sandbox so that they can be traced in the Console app.

Add Touchbar support

What would that look like? Show most used scripts? Or let the user pick from recent ones?

Maybe clear and run again would be nice.

Performance issues

Currently, the syntax highlighting is not super optimized, which cause performance issues on large strings.

Possible solutions:

  • Migrate away from regex (Would this help?)
  • Disable any multi-line regex, to see if it speeds things up.
  • Add lazy highlighting. Only highlight viewport, and only when changed.

Support TextEncoder and TextDecoder API

Working with UTF-8 in JavaScript requires a lot of code and is very error prone. The TextEncoder and TextDecoder APIs would make this a lot easier to encode and decode between strings and bytes.

This is especially useful when you work with Uint8Array, for example to encode UTF-8 strings as hexadecimal and back.

Feature Request

Text uppercased / lowercased would be awesome!

Thank you for your App.

dynamic reload of custom scripts

Really liking Boop! Is it possible to monitor the custom scripts folder so I don't have to quit and reopen the app the reload new scripts or changes?

Hex to Dec

Hi,

one more script :)

**
{
"api":1,
"name":"Hex to Decimal",
"description":"Convert Hex to Dec",
"author":"Guillaume",
"icon":"quote",
"tags":"hex,dec,convert"
}
**/
function main(input) {
input.text = parseInt(input.text, 16)
}

Support multiple files at once

I would like to look at multiple instances of formatted JSON at once, so adding tabs or, at the very least, a new window option would be very nice.

Add `insertion` property for custom scripts

Scripts may want to add data at the current insertion point, rather than replace data.

Reason for request: I just wrote a Lorem Ipsum script and realized it can't just insert a lipsum paragraph into an existing string. It can only replace the fullText or replace a (non-zero-length) selection.

Totally invented use cases for insertion:

  • get today's date
  • roll a die
  • flip a coin

Light mode

The app doesn't look good in light mode. The UI is somewhat brown (I assume it mixes the color with my wallpaper), the content of the text field, is hardly readable.

image

Select top result

The fuzzy search results work well, but it would be nice if the top result was automatically selected so that I don't have to arrow down to the match.

Add support for URL scheme

Boop seems like an ideal place to pipe shell output. For example:

curl -s https://example.com/api/whatever | boop

Once in Boop, you can use its scripts for formatting JSON, XML, or whatever.

To do this, you'll need to implement a URL scheme. On macOS, it's not as simple as on iOS, but it's still possible. Here is a good example:

https://github.com/isee15/Mac-OSX-custom-url-scheme

Once you have the URL scheme implemented, you can use it to send data. Here's an example from my app Tot (https://tot.rocks):

https://gist.github.com/chockenberry/d33ef5b6e6da4a3e4aa9b07b093d3c23

Using AppleScript from Swift is probably going to be weird, but worth it for the added functionality.

Powershell syntax highlight

doing powerhsell on a mac ... yes it's possible ... doing powershell on a windows VM as your main OS is macOS is really frequent :->

Feature Request: Encoding/Decoding JWTs

Functionality like that found in https://jwt.io would be awesome. I would love to work with JWTs in a native app instead of another web app. I'm not a swift developer but I would even be willing to help/contribute to make it happen.

Custom font + themes

I would love to use my favorite font (with ligatures too) and customize the appearance of the editor

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.