Comments (8)
A user cannot really distinguish a "third-party" action from a "first-party" action, since this attribute isn't explicitly specified in the Shortcuts app.
Do third-party actions refer to those actions that do not have an identifier starting with 'is.workflow.actions.'
?
As an example, the Post on Facebook action is a first-party action although it refers to a third-party app, and this may led to confusion.
Post on Facebook => is.workflow.actions.postonfacebook
If in the near future the Facebook app will add support for custom third-party shortcuts actions, then we will have actions in different groups/sub-modules that belong to the same app: the ones starting with 'is.workflow.actions.'
and the ones starting with 'com.facebook.'
as identifier.
Early, I suggested
pythonista.editScript();
pythonista.runScript();
just to distinguish those actions from future actions that may have a similar or equal shown name.
I would not reject the possibility to call those actions with completely custom names, like
editPythonistaScript();
runPythonistaScript();
if a good documentation is provided on the cool Shortcuts Fun website (really, those css, that editor.. I do really like how you presented that website!).
Can we work on a documentation page in which all the actions are grouped and listed as they shows up in the Shortcuts app? That way users won't have any problems distinguishing all the actions and getting the right function names used in this node module.
from shortcuts-js.
Finally made a decision on this and went with @xAlien95's initial suggestion. See #37 for the exact implementation.
from shortcuts-js.
I would use:
import { pythonista } from '@joshfarrant/shortcuts-js/actions';
pythonista.editScript();
pythonista.runScript();
This would work well also in your site's Playground. Regarding the directory structure, I would prefer to have camelCased folders:
├─ actions
│ ├─ pythonista
│ │ ├─ editScript.ts
│ │ ├─ index.ts
│ │ └─ runScript.ts
│ ├─ addToVariable.ts
│ ├─ ask.ts
│ ├─ calculate.ts
│ ├─ ...
CamelCase will homogenize app names and built-in action names.
It could be based on the app name rather than the last bit of the action identifier, so:
└─ actions
├─ editorial
├─ pythonista
└─ tally
from shortcuts-js.
I think what @xAlien95 has suggested sounds great.
We’ll need to be mindful about naming as some apps will be very similar...
As an example here are 2 of the Carrot apps:
Carrot⁵ (Carrot Weather)
Carrot³ (Carrot Fit)
from shortcuts-js.
I like the explicit namespacing of @xAlien95's solution, as well.
from shortcuts-js.
I do like that this is quite a clean solution. My only concern with this is that it introduces the possibility of collisions between action names and app names. It’s not unreasonable to think that there could be an app called calculate
or list
, in which case what would
import { list } from ‘@joshfarrant/shortcuts-js/actions’;
actually import?
Do we just have to make special cases for those and set the app name as listApp
?
from shortcuts-js.
Prefacing each app action group with app[appName] could be a good way to do this. From a folder structure POV it would keep them all together too rather than spread between the native actions in alphabetical order (for the most part)
from shortcuts-js.
What about an apps directory in src/actions
? You could then do something like:
import {
pythonista,
} from ‘@joshfarrant/shortcuts-js/actions/apps’;
pythonista.editScript();
We could then also expose an apps
variable in the default actions export.
import {
apps,
} from ‘@joshfarrant/shortcuts-js/actions’;
const {
pythonista,
} = apps;
pythonista.editScript();
People can then use whichever method they prefer.
from shortcuts-js.
Related Issues (20)
- ChooseFromMenu not defined HOT 3
- iOS 13 Beta does not support Shortcut imports through AirDrop HOT 16
- Color and glyphs are not available HOT 3
- Add Bear actions
- Is it possible to port the "shortcuts" app to Android? Parsing the file format and Implement the action. HOT 1
- Speak Text HOT 3
- Better Contribution flow
- Add Replace Text Action
- Add Change Case Action
- Error in REDME
- Hacktoberfest Opt-in HOT 1
- Shortcut parser needs to support both binary bplist and xml plist
- Creating ShortCut URL in iCloud
- How do I get started? HOT 1
- Add getFile Action
- Looking for new maintainers 💖 HOT 21
- Json shortcut
- Getting Shortcuts to "tap" items on the screen HOT 1
- Chrome warns about usage of navigator.userAgent, navigator.appVersion, and navigator.platform HOT 1
- Shortcut for iOS setting?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shortcuts-js.