Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix grabbing multiple MAC addresses in some cases when AirPods is not…
… connected
- Loading branch information
5529cd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With macOS 12.6, I still need to use the original version.
5529cd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no idea what you mean.
5529cd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my output of
SYSTEM_PROFILER
MAC_ADDRESS
would beFF:FF:FF:FF:FF:FF
, the one that is not connected.5529cd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. so when you say:
that means the latest version doesn't work? of this workflow? by original you mean the one from which this workflow is forked? the original one works?
5529cd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been using your workflow, not a fork.
The latest version with this change of
awk '/Address/{print $2}'
->awk '/Address/{ lastline = $2 } END { print lastline }
will grab the last not connected headphones' MAC address.Before this commit, it will print all headphones MAC address, which can be fed to the following commands to get the connect AirPods.
5529cd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh ok, i think i got it. i ported an improvement that someone made in the alfred airpodspro connector: godbout/alfred-airpodspro-connector#3
personally i don't use multiple headphones so i'm not sure exactly how it works again. if i revert for this workflow, that would help your case? you're still gonna deal with multiple MAC addresses, and if i reckon the Workflow will not handle this well.
5529cd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If only one is connected, it turns out to be o.k. fo
MAC_ADDRESS
to have multiple addresses including not connected onesawk '/Case Battery Level/{print $4}
will only grab from the connected one and ignore unconnected MAC addresses.I am experimenting with multiple connected devices. I know very few bash scripts, will try to make it pretty and create a PR later.
5529cd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol. the PR is so nice 😂️