splash icon indicating copy to clipboard operation
splash copied to clipboard

Use ScPL as language

Open hosy opened this issue 5 years ago • 7 comments

I really like your idea, unfortunately there needs to implement all possible actions. Why you don not use ScPL? https://github.com/pfgithub/shortcutslang

hosy avatar Mar 12 '19 10:03 hosy

Both languages have different purposes. I've explained my thoughts on their difference here. I plan to implement more actions ASAP.

gonzula avatar Mar 12 '19 11:03 gonzula

I'm the developer of ScPL, if by "using scpl" you mean adding it to the splash app, it would probably be difficult to include ScPL in a native app since it's written in javascript, the same reason it would be difficult to have a web editor and compiler for Splash.

pfgithub avatar Mar 15 '19 16:03 pfgithub

I got scpl running in the splash app using JavaScriptCore in my fork (https://github.com/pfgithub/splash). Given that the app is called splash, it probably doesn't make sense to also include ScPL so I'm not sure what to do with it.

pfgithub avatar May 06 '19 18:05 pfgithub

Nice implementation! I really enjoyed it. I think that would be cool to have scpl in the app. At first I was worried about bloating the app with big frameworks and such, but your implementation is very lightweight. Unfortunately it's not possible to change the app name. I don't see a problem in keeping the name but I understand that you have reasons to think differently from me. Inside the app we can do some branding showing both languages. If you don't feel like going in this direction, you can release the scpl fork as another app.

gonzula avatar May 07 '19 12:05 gonzula

I don't see a problem in keeping the name either.

Things that need to be done in the scpl fork

  • [X] Make the document type work (f8a21f2e5f471ee24d6f183e11be2e9b4ec04311)
  • [ ] Add a new syntax highlighter for scpl
  • [ ] Update the keyboard buttons in scpl
  • [ ] Add inversion support (.shortcut -> .scpl)
  • [ ] Add error messages in the code

Future goals:

  • [ ] @import macro to include other files in the shortcut
  • [ ] autocomplete actions/variables

pfgithub avatar May 07 '19 14:05 pfgithub

And here's another approach. Shortcuts JS Shortcut JS by Josh Farrant, site Shortcuts Fun This, however, requires the knowledge of JavaScript language, so it defeats the purpose of it being for non-programmers which I belong to. And it's a pity because (1) I'm scripting with AppleScript so I'm familiar with the basic concepts and logic (2) drag-n-drop in a small screen of iPhone SE is a pain so writing it as a compilable plain text file is more convenient.

Is ScPL much like Shortcuts JS? Most importantly, what's the syntax of actions (some sort of dictionary needed like the dictionaries for scripted applications in Script Editor or Script Debugger). E.g., what's the code for the action of getting the battery charge level, geo-location, or downloading files at a given URL? What if I want to create error check actions and the "Exit Loop" action, and, generally, any action I want (that is, not supplied by Apple)? Is it possible?

scrutinizer11 avatar Feb 05 '21 00:02 scrutinizer11

@scrutinizer11 neither ScPL or shortcuts.js are maintained anymore. The thing that is currently maintained is Jellycuts which is not open source.

E.g., what's the code for the action of getting the battery charge level, geo-location, or downloading files at a given URL? What if I want to create error check actions and the "Exit Loop" action, and, generally, any action I want (that is, not supplied by Apple)? Is it possible?

GetBatteryLevel
GetCurrentLocation
GetContentsOfURL ^(URL "https://url.com") method="GET" 

The Exit Loop action seems to be a new thing, and ScPL hasn't been updated since iOS 12 so it is not supported. Assuming it lets you pick which loop to exit from, it would probably be similar to magic variable syntax if I were to update ScPL.

I'm not sure what jellycuts syntax is but it's probably somewhat similar. I'm also not sure if jellycuts supports non-native actions, but it might.

pfgithub avatar Feb 05 '21 01:02 pfgithub