2024-06-20 08:24:14 +02:00
|
|
|
#!/usr/bin/env nu
|
|
|
|
|
|
|
|
let appleScript = {|it| '
|
|
|
|
tell application "Music"
|
|
|
|
set _duration to duration of current track
|
|
|
|
|
2024-07-28 20:56:21 +02:00
|
|
|
set player position to (' + ($it | into string) + ' * _duration)
|
2024-06-20 08:24:14 +02:00
|
|
|
end tell'}
|
|
|
|
|
|
|
|
if ($env.PERCENTAGE? != null) {
|
|
|
|
osascript -e (do $appleScript (($env.PERCENTAGE | into int) / 100.0))
|
|
|
|
}
|