GithubHelp home page GithubHelp logo

ninest / aquaui Goto Github PK

View Code? Open in Web Editor NEW
29.0 1.0 0.0 1.66 MB

Display native dialogs, alerts, notifications, color pickers, and more with Python

License: MIT License

Python 100.00%
macos dialog cocoa notifications python python3 applescript pyobjc objc aqua

aquaui's Introduction

aquaui's People

Contributors

dependabot[bot] avatar ninest 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

Watchers

 avatar

aquaui's Issues

Telling and titles for dialog

tell application "Brave Browser" to display dialog "Some Message from Brave" with title "A title"

This will show a dialog with a title at the top, and move focus to Brave Browser.

If you tell application then display an alert, it will show Brave's icon.

But showing a notification after tell will not change the notification's icon, unfortunately.

Change the way an applescript is generated

Currently, an applescript is generated as a string. Nothing too complex to it. The problem is that it's easy to miss out a space here or there

self.applescript = f"display dialog {quotify(text)} "
# Notice the space at the end

It may be better to do something like

self.applescript = ["display dialog", quotify(text)]

...

# Adding title
self.applescript.extend(["with title", quotify(title)])

Then using a loop, create the applescript and appropriately put spaces

Escaping double quotes

Single quotes work fine, but double quotes don't.

All double quotes are escaped:

script = script.replace('"', '\\"')

and this causes issues when there are double quotes in the string.

from aquaui import Alert, Buttons

# Works
Alert("How're you?").show()

# Doesn't work
Alert('How"re you?').show()
Alert('How\\"re you?').show()

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.