Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Script launcher via html page. Possible?

I wish I could create an html page with links to scripts. All locally on my computer.


The idea would be: use the html page to have a page with a graphic created ad hoc and the possibility of launching my scripts in a pleasant environment without having to go and click in the finder.


The scripts would be .app files, created with Applescript which launch shells, each with a custom terminal profile.


But I need an interactive script launcher bar and the html page looks ideal.


On this page I think we are talking about this thing: https://www.macosxautomation.com/applescript/linktrigger/

Here we talk about the "Info.plist file" and of the Script Code.


I tried to follow the instructions but the link I created in the html page does not launch the script.

It is not clear to me where the commands described in the article should be pasted.


Can someone help me?

Mac Pro, OS X 10.11

Posted on May 30, 2019 3:20 PM

Reply

Similar questions

10 replies

May 31, 2019 4:31 PM in response to appletired

You could register your own URL scheme and associate that with a Automator app that does what you want.

https://developer.apple.com/documentation/uikit/core_app/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app

Warning
URL schemes offer a potential attack vector into your app, so make sure to validate all URL parameters and discard any malformed URLs. In addition, limit the available actions to those that do not risk the user’s data. For example, do not allow other apps to directly delete content or access sensitive information about the user. When testing your URL-handling code, make sure your test cases include improperly formatted URLs.


Or why not just create a bunch of Automator Apps, or Automator Services, or Automator Dictation commands


For Automator Apps:

  • You can place them on the Dock for a single click activation
  • You can place them in a folder, and put that folder on the Dock, for a click on the folder, and a click on the app to activate
  • You could put them in a Finder top tool bar
  • You could put them in the Finder side-bar
  • You could put them on the desktop.
  • You could access them via the Launcher


Services would be accessible via the Applications Services menu, or Right-click on a file and access services from the right-click popup


You can assign hotkeys to services or apps


I have not played with Dictation commands, so either experiment or do some Google searching

Jun 8, 2019 12:05 AM in response to BobHarris


BobHarris wrote:

You could register your own URL scheme and associate that with a Automator app that does what you want.
https://developer.apple.com/documentation/uikit/core_app/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app


Please, Bob

This possibility is valid only for iOS and TVOS.


Is Mac OS X excluded?




May 30, 2019 6:28 PM in response to appletired

In todays more security-conscious world, I'm pretty sure having a web page launch some arbitrary document (let alone application) on your system would be considered a huge risk.


Indeed, hacking together a simple web page with links to files on disk sort of confirms this - Safari will activate the Finder and will select a specified file, but it won't launch/open it.


It may be possible digging deeper, but I suspect that a web front end to your scripts is going to be a long, hard road.

May 31, 2019 12:50 PM in response to rccharles

There are some URI prefixes that Apple has registered with the operating system for use with a browser. The following will open the Dictionary application from Safari (or Firefox) to the word "cat.". Either browser will pop a JavaScript dialog to challenge that you actually want open the dictionary application (on Mojave).


dict://cat

May 31, 2019 2:20 PM in response to rccharles


Italiano


Inglese


Already I know how to launch shell via applescript. Maio I would like to launch numerous scripts from a bar where you can have so many labels to click on to launch the scripts. In this way between the browser and the terminal it could seem to be always in the same environment. Without having to go through the Finder. I thought it was an easy way to use HTML because I already know it. Instead you tell me it's impossible. Then I realized that I will have to learn to use xcode ... I was hoping for an easier way.




Script launcher via html page. Possible?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.