小编Die*_*des的帖子

如何使用 jq 解析 json 中编码为字符串的 json

有什么方法可以在单个命令中使用 jq 解析此 json 吗?我想做这样的事情:jq .key.first。但是,是的,考虑到这key是一个字符串,需要首先解析为 json。

{
  "key": "{\"first\":\"123\",\"second\":\"456\"}"
}
Run Code Online (Sandbox Code Playgroud)

json jq

5
推荐指数
2
解决办法
2572
查看次数

如何使用 Automator 调整 Visual Studio Code 窗口大小?

我正在尝试进行截屏视频,为此,我想每次都以相同的大小记录 VSCode 窗口。为此,我尝试使用 Automator 脚本来调整窗口大小。它适用于我测试过的所有应用程序,但不适用于 VSCode。

这是脚本:

(* This AppleScript will resize the current application window to the height specified below and center it in the screen. Compiled with code from Natanial Wools and Amit Agarwal *)
    
    set the_application to (path to frontmost application as Unicode text)
    set appHeight to 720
    set appWidth to 1280
    
    tell application "Finder"
        set screenResolution to bounds of window of desktop
    end tell
    
    set screenWidth to item 3 of screenResolution
    set screenHeight to item 4 …
Run Code Online (Sandbox Code Playgroud)

macos automator visual-studio-code

3
推荐指数
1
解决办法
738
查看次数

标签 统计

automator ×1

jq ×1

json ×1

macos ×1

visual-studio-code ×1