Giter VIP home page Giter VIP logo

Comments (7)

Dupond avatar Dupond commented on August 22, 2024 1

Thanx! I had even guessed what the new command would be by myself ;) Your new syntax is indeed much easier to read!

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

Try putting a backslash \ before the sharp.

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

If that doesn't work add spaces outside each double quotation mark.

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

Ok, I figured out the issue, sharp is the character used for comments, so we need to encapsulate it within a string. If there are characters adjacent to the outside quotation mark then the string won't be encapsulated, so we need spaces around the quotes.

However, that is not the only issue, JSON syntax requires the double quotes to be part of the actual string, but by properly encapsulating the string the double quotes will be removed, hence we need to put the quotes inside the quotation marks as well, which requires an escape character.

This should work:
V script-message cycle-commands [ [["set","sub-font","Sans"],["set","sub-color", "\"#FFFF00\"" ]] , [["set","sub-font","Sans"],["set","sub-color", "\"#000000\"" ]] ]

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

This is a bit annoying, but should only happen with a very limited number of special characters. Still, I may need to put this into the documentation, thanks for bringing it to my attention.

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

3314e34 added new documentation.

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

Gonna leave this here in case anyone finds this:

Under the new syntax I just moved to the command would be:

V script-message cycle-commands "set sub-font Sans ; set sub-color \"#FFFF00\"" "set sub-font Sans ; set sub-color \"#000000\""

Strings with Hashes in them still need quotation marks around them

from mpv-scripts.

Related Issues (19)

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.