Stupid Mac::Glue Tricks
I find one-liners in Mac::Glue to be annoying.
perl -MMac::Glue=:all -le '$itunes = new Mac::Glue "iTunes"; print $itunes->prop("player state")->get'It's a mouthful, and mostly boilerplate. So how about this little shell script? Standardize on one glue var name, $g, and suck in Data::Dumper, which I commonly use, and:
#!/bin/shNow I can do:
perl -MMac::Glue=:all -MData::Dumper -l -e 'splice(@ARGV, 1, 1); $g = new Mac::Glue shift;$g->ERRORS(1);' -e "$2" "$@"
glue iTunes 'print $g->prop("player state")->get'
Leave a comment