Skip to content

[WIP] Julia package for obtaining GUI information for macOS users only

License

Notifications You must be signed in to change notification settings

terasakisatoshi/QuartzGetWindow.jl

Repository files navigation

QuartzGetWindow Build Status Stable Dev

About this repository

Usage & application

Installation

Just run the following script with Julia package REPL

% julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.2 (2022-02-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.7) pkg> add https://github.com/terasakisatoshi/QuartzGetWindow.jl
  Installing known registries into `~/.julia`
     Cloning git-repo `https://github.com/terasakisatoshi/QuartzGetWindow.jl`
    Updating git-repo `https://github.com/terasakisatoshi/QuartzGetWindow.jl`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
   Installed Crayons ─ v4.1.1
   Installed Replay ── v0.4.2
    Updating `~/.julia/environments/v1.7/Project.toml`
  [400ccb3a] + QuartzGetWindow v0.1.0 `https://github.com/terasakisatoshi/QuartzGetWindow.jl#main`
    Updating `~/.julia/environments/v1.7/Manifest.toml`
  [a8cc5b0e] + Crayons v4.1.1
  [400ccb3a] + QuartzGetWindow v0.1.0 `https://github.com/terasakisatoshi/QuartzGetWindow.jl#main`
  [dd78c5bf] + Replay v0.4.2
  [8f399da3] + Libdl
  [6462fe0b] + Sockets
Precompiling project...
  3 dependencies successfully precompiled in 2 seconds
pkg> add https://github.com/terasakisatoshi/QuartzGetWindow.jl
pkg> add Replay

You can remove QuartzGetWindow anytime via pkg> rm QuartzGetWindow.

Running script

This pacakge may partially solve this issue. To prove that, We provided examples/demo.jl.

% git clone https://github.com/terasakisatoshi/QuartzGetWindow.jl.git
% cd QuartzGetWindow
% cat examples/demo.jl
using Dates

using Replay

using QuartzGetWindow

function takemov()
    x, y, w, h = getWindowGeometry(getActiveWindow())
    file = "$(Dates.now()).mov"
    run(`screencapture -R$(x),$(y),$(w),$(h) -v $(file)`)
end

function record()
    instructions = [
        "println(\"Hello QuartzGetWindow!!!\")",
        """
        for i in 1:5
            sleep(0.1)
            println(i)
        end
        println("Done")
        """,
    ]
    @async takemov()
    replay(instructions)
    exit()
end

record()
% julia examples/demo.jl

This will record a screen running julia instructions within your terminal and store the recording to a video file with mov format e.g. 2022-04-19T22:19:24.344.mov.

2022-04-19T22.26.04.442.mov

About

[WIP] Julia package for obtaining GUI information for macOS users only

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published