Thursday, July 9, 2020

#1 2020-03-30 03:59:29 pm

Fredrik71
Member
Registered: 2019-10-23
Posts: 282

bash, siri shortcuts, web, trigger...

Hi All

EDIT: The reason of this topic is to explore other ways to execute commands from a visual experience.

There innovation take next step.
https://www.touch-portal.com
https://www.metasystem.io

Useful Script folder become a visual experience on touch display, with beautiful icons.

Or

People who make 560 icons to choose from in a creative enviroment.
http://www.sideshowfx.net/after-effects … collection

AppleScript could be so much more to execute actions.

bash, python, javascript, ruby, to have hundreds of buttons to do useful actions.

Last edited by Fredrik71 (2020-04-02 09:31:40 am)


I  have skied the highest mountain without logic, and still its the imagination that take me anywhere. Its the desire of something that matters for any knowledge I have or could learn.

Offline

 

#2 2020-03-30 08:11:30 pm

maro
Member
From:: Nerima, Tokyo, Japan
Registered: 2004-05-30
Posts: 106
Website

Re: bash, siri shortcuts, web, trigger...

Few years ago, I had have an idea of CLI wrappling interface with AppleScript.

I found CLI has best performance with limited commands. The increment of amount of CLI commands brings the decrement of CLI usability...

If you mean "unlimited parameter", it sounds nice.


I wrote thousands of AppleScript to realize my idea. Natural language interface, voice recognition commander and so on. Though my mother toungue is strange language, Japanese, my most frequently write language is AppleScript. I believe it is for making things easy and powerful.

Offline

 

#3 2020-03-31 12:27:36 am

Fredrik71
Member
Registered: 2019-10-23
Posts: 282

Re: bash, siri shortcuts, web, trigger...

My approach is to make a bash script that take if/else statement...

if the bash script basename is kn and the commandName is makeNewSlide and 1 will be params for commandName.

ex. kn makeNewSlide 1

We could also have in bash script the path to the script folder.

#!/usr/bin/env bash

if [ $1 == 'makeNewSlide' ]
then
  osascript /usr/local/Keynote/Scripts/makeNewSlide.scpt "$@"
else
echo "Command is missing value"
fi

The if/else in bash script will execute the specific AppleScript.

As you could see in the AppleScript the params for commandName will be item 2 of argv.

Applescript:

on run argv
   
   set aList to {}
   
   try
       repeat with i from 1 to (count items of argv)
           if (count items of argv) > 0 then
               copy item i of argv to end of aList
           end if
       end repeat
   end try
   
   --~~~~~~~~~~~~
   
   repeat with i from 1 to (get item 2 of aList)
       makeNewSlide()
   end repeat
   
end run

on makeNewSlide()
   tell application id "com.apple.iWork.Keynote"
       tell front document to make new slide
   end tell
end makeNewSlide

Last edited by Fredrik71 (2020-04-02 09:29:47 am)


I  have skied the highest mountain without logic, and still its the imagination that take me anywhere. Its the desire of something that matters for any knowledge I have or could learn.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)