Tuesday, May 11, 2021

#1 2021-04-07 05:48:44 am

NMG
Member
Registered: 2019-09-29
Posts: 54

Activate or open the script

Is there a way I can call my script/app when I am in another app?

I have a script/app that works well. I use it frequently with Apple Pages. To activate it I have to go to the Dock, click the app, and go back to Pages. It is not a big deal but when I do that many, many times I think it could be very useful to be able to call my script/app only with the keyboard while I am in Pages. I mean, without leaving the keyboard. Is that possible to do?

Offline

 

#2 2021-04-07 06:53:11 am

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 872

Re: Activate or open the script

NMG wrote:

Is there a way I can call my script/app when I am in another app?

I have a script/app that works well. I use it frequently with Apple Pages. To activate it I have to go to the Dock, click the app, and go back to Pages. It is not a big deal but when I do that many, many times I think it could be very useful to be able to call my script/app only with the keyboard while I am in Pages. I mean, without leaving the keyboard. Is that possible to do?



NMG. There are a number of approaches that will allow you to do what you want, and one is to use an Automator Quick Action. This is a bit cumbersome but is probably adequate with just a few scripts. There are many  web postings that explain how this is done and the following is just one:

https://www.addictivetips.com/mac-os/ru … -on-macos/

Another approach is to use a utility designed for this purpose, one example of which is FastScripts. This utility is free for use with up to 10 shortcuts and is $24.95 afterwards. I'm sure there are many other similar utilities.

https://redsweater.com/fastscripts/

You specify a keyboard-only approach but, just to be complete, a mouse-based option is to enable the script menu by way of Script Editor preferences.

Last edited by peavine (2021-04-07 07:10:07 am)


2018 Mac mini - macOS Catalina

Offline

 

#3 2021-04-08 04:18:12 am

NMG
Member
Registered: 2019-09-29
Posts: 54

Re: Activate or open the script

to enable the script menu by way of Script Editor preferences.



I do not understand. What do you mean by that?

Offline

 

#4 2021-04-08 09:54:59 am

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 872

Re: Activate or open the script

NMG wrote:

to enable the script menu by way of Script Editor preferences.



I do not understand. What do you mean by that?



NMG. Do the following:

1) open Script Editor
2) open Preferences
3) select the General tab
4) put check marks next to "Show Script menu in menu bar" and "Show Computer scripts"
5) click on the new Scripts Menu icon in the menu bar and you will see Computer scripts plus your own scripts (if there are any)

Last edited by peavine (2021-04-08 10:11:33 am)


2018 Mac mini - macOS Catalina

Offline

 

#5 2021-04-08 12:33:13 pm

wch1zpink
Member
Registered: 2011-08-20
Posts: 18

Re: Activate or open the script

peavine wrote:
NMG wrote:

to enable the script menu by way of Script Editor preferences.



I do not understand. What do you mean by that?



NMG. Do the following:

1) open Script Editor
2) open Preferences
3) select the General tab
4) put check marks next to "Show Script menu in menu bar" and "Show Computer scripts"
5) click on the new Scripts Menu icon in the menu bar and you will see Computer scripts plus your own scripts (if there are any)


On macOS Big Sur, It is no longer necessary to have to resort to UI Scripting by activating Script Editor then opening its preferences etc.
This following AppleScript code will do the trick.

Applescript:

tell application "AppleScript Utility"
   if not Script menu enabled then
       set Script menu enabled to true
       set application scripts position to top
       set show Computer scripts to true
   else
       set application scripts position to top
       set show Computer scripts to true
   end if
end tell

Offline

 

#6 2021-04-09 09:22:16 am

NMG
Member
Registered: 2019-09-29
Posts: 54

Re: Activate or open the script

Thank you all for the help!

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)