Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Pythonista block Phone calls / WhatsApp call
-
See here
-
-
-
@DavinE said:
Is it possible go back to Pythonista ?
I don't think so but your shortcut could relaunch Pythonista with an argument telling to your Pythonista script that it is called back
-
@DavinE said:
can Pythonista set the airplane mode
I think that it could be possible in Objectivec, but it could be not allowed by an Apple rule because it uses a private API.
-
Code to get airplane mode but set does not work
from objc_util import * RadiosPreferences = ObjCClass('RadiosPreferences').alloc().init() print(RadiosPreferences.airplaneMode()) # set does not work RadiosPreferences.setAirplaneMode_(False) RadiosPreferences.synchronize()
-
Perhaps one solution.
YOu can, with the Shortcuts app, create an automatic shortcut "activate airplane mode" when you receive a mail from your-self with a particular subject.
And your Pythonista script has only to send tHis mail when you want to set airplane mode.I'm proud of me 😂 but I did not test it.
-
There is also an automation, when App is open.
-
@7upser yes but perhaps you don't want it each time you open Pythonista, for instance during development.
-
good argument
-
@7upser finally, when you work on Pythonista and you don't want To be interrupted by a phone call, why not use control center, this one does not interrupt your Pythonista App.
-
@7upser I read one more time your initial post, and you speak also about WhatsApp, and this one works in wifi, thus will still function if Airplane mode is activated.
-
@cvp It wasn't my Thread 😛
But you are right Phone calls and WhatsApp are different things.
Maybe there is a url scheme for whats app, or a action for Shortcuts.But back to what i'm interested in (call shortcut and return to pythonista)
This could work:import ui import webbrowser class cUIView(ui.View): def __init__(self, *args, **kwargs): self.width, self.height = 200, 200 self.background_color = 'silver' self.vBtn = ui.Button(title = 'test', name = 'btntest') self.vBtn.frame = (50, 50, 100, 100) self.vBtn.background_color = 'white' self.vBtn.action = self.btnAction self.add_subview(self.vBtn) def btnAction(self, vSender): url = 'shortcuts://x-callback-url/run-shortcut?name=testBluetoothOff&x-success=pythonista3://' webbrowser.open(url) vView = cUIView() vView.present('sheet')
-
-
@7upser said:
This could work:
Sure but as you can start the same app normally or launched by Shortcuts, you have to check arguments to differentiate both types of calls
-
-
@7upser said:
@cvp It wasn't my Thread 😛
But you are right Phone calls and WhatsApp are different things.
Maybe there is a url scheme for whats app, or a action for Shortcuts.But back to what i'm interested in (call shortcut and return to pythonista)
This could work:import ui import webbrowser class cUIView(ui.View): def __init__(self, *args, **kwargs): self.width, self.height = 200, 200 self.background_color = 'silver' self.vBtn = ui.Button(title = 'test', name = 'btntest') self.vBtn.frame = (50, 50, 100, 100) self.vBtn.background_color = 'white' self.vBtn.action = self.btnAction self.add_subview(self.vBtn) def btnAction(self, vSender): url = 'shortcuts://x-callback-url/run-shortcut?name=testBluetoothOff&x-success=pythonista3://' webbrowser.open(url) vView = cUIView() vView.present('sheet')
Thats nice xD
Thanks -
This post is deleted!