Share via - post to url. Possible?

General discussions about Automagic and automation in general

Moderator: Martin

Taapo
Posts: 6
Joined: 05 Jul 2015 08:32

Share via - post to url. Possible?

Post by Taapo » 27 Sep 2015 15:43

Is it possible to visit a page in a browser, select the "share via" action feom the menu, choose automagic from the list and have the link posted to a custom url?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Share via - post to url. Possible?

Post by Martin » 27 Sep 2015 17:47

Hi,

The next version of Automagic (1.29) supports a new trigger Send/Share Intent Received for this purpose. You can download a preview of the next version in the EAP forum.

Regards,
Martin

Taapo
Posts: 6
Joined: 05 Jul 2015 08:32

Re: Share via - post to url. Possible?

Post by Taapo » 29 Sep 2015 10:18

Looks awesome, and I was able to open a URL.

Can somebody help me pass the current URL (if you are in a webbrowser) pass to the open URL command? Or am I misinterpreting the possibilities?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Share via - post to url. Possible?

Post by Martin » 29 Sep 2015 12:52

You could build a flow like this:

-trigger Send/Share Intent Received
-action Open URL in Browser: {text}

You can use the Share-button in the browser and pick Automagic Send/Share Intent Received from the list which will execute the flow. The trigger makes some variables available to the flow. Check out the help page of the trigger and scroll to the section 'Supplied Variables'. In such cases it's often also helpful to build a test flow first to inspect the available variables and the contained values:

-trigger Send/Share Intent Received
-condition Debug Dialog

In case of Chrome, the URL becomes available in variable text. {text} will be replaced with the contents of the variable text when the action is executed.

Regards,
Martin

Taapo
Posts: 6
Joined: 05 Jul 2015 08:32

Re: Share via - post to url. Possible?

Post by Taapo » 30 Sep 2015 07:13

Awesome!

Can we urlencode the {text} variable in some way?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Share via - post to url. Possible?

Post by Martin » 01 Oct 2015 11:25

Yes, you can use {encodeURL(text)} (encodes spaces to %20) or {encodeURLForm(text)} (encodes spaces to +).
Also see the documentation about script functions in the help page of action Script or by using the Function-button in action Script.

User avatar
Bluscre
Posts: 145
Joined: 31 Aug 2017 13:58
Location: Germany
Contact:

Re: Share via - post to url. Possible?

Post by Bluscre » 01 Nov 2019 03:33

Can we have a action for the opposite? Action Open share menu
Unofficial AutoMagic Telegram Group: https://t.me/automagicforandroid
Check out my other flows here: https://github.com/Bluscream/AutoMagicFlows or here.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Share via - post to url. Possible?

Post by Desmanto » 03 Nov 2019 18:45

Bluscre wrote:
01 Nov 2019 03:33
Can we have a action for the opposite? Action Open share menu
It can be done via Start Activity, action : android.intent.action.SEND
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Bluscre
Posts: 145
Joined: 31 Aug 2017 13:58
Location: Germany
Contact:

Re: Share via - post to url. Possible?

Post by Bluscre » 04 Nov 2019 02:54

Thanks ^^
Unofficial AutoMagic Telegram Group: https://t.me/automagicforandroid
Check out my other flows here: https://github.com/Bluscream/AutoMagicFlows or here.

User avatar
Bluscre
Posts: 145
Joined: 31 Aug 2017 13:58
Location: Germany
Contact:

Re: Share via - post to url. Possible?

Post by Bluscre » 04 Nov 2019 08:22

Sadly it didnt work for me

Code: Select all

04.11.2019 09:21:35.197 [Open URLs] Action 'Start Activity: android.intent.action.SEND {data_string} ' Could not start activity using intent: Intent { act=android.intent.action.SEND dat=https://automagic4android.com/... flg=0x10000000 }
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND dat=https://automagic4android.com/... flg=0x10000000 }
	at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1809)
	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1523)
	at android.app.ContextImpl.startActivity(ContextImpl.java:682)
	at android.app.ContextImpl.startActivity(ContextImpl.java:664)
	at android.content.ContextWrapper.startActivity(ContextWrapper.java:331)
	at ch.gridvision.ppam.androidautomagic.model.a.gt.a(SourceFile:386)
	at ch.gridvision.ppam.androidautomagic.model.a.d$1.b(SourceFile:416)
	at ch.gridvision.ppam.androidautomagiclib.util.cj$1$1.run(SourceFile:52)
	at android.os.Handler.handleCallback(Handler.java:815)
	at android.os.Handler.dispatchMessage(Handler.java:104)
	at android.os.Looper.loop(Looper.java:207)
	at android.app.ActivityThread.main(ActivityThread.java:5765)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
	at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)

04.11.2019 09:21:35.212 [Open URLs] End executing action 'Start Activity: android.intent.action.SEND {data_string} ' and exception No Activity found to handle Intent { act=android.intent.action.SEND dat=https://automagic4android.com/... flg=0x10000000 }
04.11.2019 09:21:35.213 [Open URLs] Flow ends execution due to errors
04.11.2019 09:21:35.213 [Open URLs] Error:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND dat=https://automagic4android.com/... flg=0x10000000 }
	at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1809)
	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1523)
	at android.app.ContextImpl.startActivity(ContextImpl.java:682)
	at android.app.ContextImpl.startActivity(ContextImpl.java:664)
	at android.content.ContextWrapper.startActivity(ContextWrapper.java:331)
	at ch.gridvision.ppam.androidautomagic.model.a.gt.a(SourceFile:386)
	at ch.gridvision.ppam.androidautomagic.model.a.d$1.b(SourceFile:416)
	at ch.gridvision.ppam.androidautomagiclib.util.cj$1$1.run(SourceFile:52)
	at android.os.Handler.handleCallback(Handler.java:815)
	at android.os.Handler.dispatchMessage(Handler.java:104)
	at android.os.Looper.loop(Looper.java:207)
	at android.app.ActivityThread.main(ActivityThread.java:5765)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
	at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)
Unofficial AutoMagic Telegram Group: https://t.me/automagicforandroid
Check out my other flows here: https://github.com/Bluscream/AutoMagicFlows or here.

Post Reply