Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there a way to share a file directly to a person with AirDrop? #2025

Closed
eggcaker opened this issue Jan 24, 2019 · 7 comments
Closed

is there a way to share a file directly to a person with AirDrop? #2025

eggcaker opened this issue Jan 24, 2019 · 7 comments

Comments

@eggcaker
Copy link

I know hammerspoon can open airdrop dialog with share items , is possible to define recipients for AirDrop sharing ?

@latenitefilms
Copy link
Contributor

Does hs.sharing:recipients([recipients]) do what you want?

@eggcaker
Copy link
Author

I tried , but I don't know how to set the recipient, for email sharing, it's the email address. But not found any doc or source code to find this for AirDrop sharing, i tried the mac host(ex: Mike's MBP) in the AirDrop dialog, not working

@asmagill
Copy link
Member

Ok, noticed some mistakes in the documentation for hs.sharing that I'll have to address later, but just to add, the documentation provided by Apple isn't exactly crystal clear on the subject either -- from their docs on the NSSharingService class and the recipients property:

Each object in the array is an NSString object that contains the handle of a single recipient. The specific format of these handle varies from service to service. For example, some services use email addresses as handles.

@eggcaker
Copy link
Author

@asmagill so you mean no way to to set the recipient correctly to send file with airdrop?

@asmagill
Copy link
Member

Without an example, I'm not sure what to try if you've already tried email addresses and names as they appear in your Contacts application. If you (or anyone else who cares to chime in) know of sample code, either from Apple's examples, or from other open source projects that we can examine the source for, I'm not sure what else to try.

It's definitely expecting an array of one or more strings, we just have no way to determine what strings it's trying to match against without more information.

@asmagill
Copy link
Member

I suppose it may be that setting a recipient to the sharing object does nothing for AirDrop and is ignored... IIRC, AirDrop shows you everyone around you -- or just in your contact list that's currently around you if you toggled that in Settings (iOS) or in the Finder's AirDrop window (OSX) -- that can currently accept items (i.e. their device is on and unlocked); I don't recall off the top of my head ever not having to select someone from the AirDrop panel once I'd selected an item to share (which isn't to say whether or not it might be possible to predetermine them, it's just not the way I've ever used it)

Again, sample code or better documentation specifically about AirDrop would help if anyone has any suggestions.

@cmsj
Copy link
Member

cmsj commented Mar 29, 2019

I’d be surprised if this is possible, the airdrop recipient can’t just be an iCloud username because airdrop goes to a specific device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants