{"id":13433999,"url":"https://github.com/Sheraff/alfred-workflow-mockup","last_synced_at":"2025-03-17T14:30:21.252Z","repository":{"id":19631862,"uuid":"22883861","full_name":"Sheraff/alfred-workflow-mockup","owner":"Sheraff","description":"Template webpage to demo your amazing workflows","archived":false,"fork":false,"pushed_at":"2014-08-14T01:08:47.000Z","size":948,"stargazers_count":15,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"gh-pages","last_synced_at":"2025-03-12T04:41:16.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://sheraff.github.io/alfred-workflow-mockup/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sheraff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-12T16:11:18.000Z","updated_at":"2023-01-18T19:11:08.000Z","dependencies_parsed_at":"2022-08-07T09:15:28.576Z","dependency_job_id":null,"html_url":"https://github.com/Sheraff/alfred-workflow-mockup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheraff%2Falfred-workflow-mockup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheraff%2Falfred-workflow-mockup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheraff%2Falfred-workflow-mockup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheraff%2Falfred-workflow-mockup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sheraff","download_url":"https://codeload.github.com/Sheraff/alfred-workflow-mockup/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244049915,"owners_count":20389601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:01:42.390Z","updated_at":"2025-03-17T14:30:20.960Z","avatar_url":"https://github.com/Sheraff.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"alfred-workflow-mockup\n======================\n\nTemplate webpage to demo your amazing workflows. \n\n[\u003e live demo](http://sheraff.github.io/alfred-workflow-mockup/)\n\n## summary \u003ca id=\"summary\"\u003e\u003c/a\u003e\nThrough a very straightforward script (see json script in `script_example.js`), this framework allows you to demo how your workflows work thanks to an **Alfred mockup**, a simple **OSX notifications** system and a **key modifiers** display.\n\n![Screen shot of mockup](screen_shot.gif)\nIf you are interested in the piratebay workflow shown in this gif, follow [this link...](https://github.com/Sheraff/piratebay-alfred-workflow)\n\n## how to script \u003ca id=\"scripting\"\u003e\u003c/a\u003e\nThe script is a simple array of states, each described by a json string. All elements are optional and have a default state (either hidden of placeholders). Here’s a list of possible elements:\n- `duration`: duration of the state in milliseconds.\n```\n// Example\n\"duration\": 1000\n```\n\n- `keypress`: emits a *pressed key* display of the specified string (similar to the *volume up* or *volume down* notifications on OSX) at the beginning of the state. The display fades out in 1 second.\n```\n// Example\n\"keypress\": \"⇥\"\n```\n\n- `notification`: emits an *osx notification* (similar to all the notifications you can see on the top right corner of your screen under OSX) at the beginning of the state. The notification enters, stills, and pans out in 4 seconds. Sub-elements are:\n  - `title`: the main text of the notification\n  - `sub`: the secondary text, written smaller and in grey.\n```\n// Example\n\"notification\": {\n\t\"title\": \"Le Coucou (1980)\",\n\t\"sub\": \"Download started...\"\n}\n```\n\n- `alfred`: describes the composition of the alfred mockup. Remove to hide Alfred. Sub-elements are:\n  - `title`: the query typed in alfred\n  - `icon`: main icon of the current workflow (this is similar to when alfred is called with a hotkey). Leave empty to default to Alfred’s icon.\n  - `list`: an array of json strings to describe the results shown in alfred. Each element is composed of:\n    - `title`: Main text of the result\n    - `sub`: Secondary text of the result\n    - `icon`: small icon for the result, leave empty to default to the main icon defined before.\n    - `selected`: boolean to indicate the selected result. If no result is described as selected, the first result is selected.\n```\n// Example\n\"alfred\": {\n\t\"title\": \"coucou0\",\n\t\"icon\": \"imgs/icon.png\",\n\t\"list\": [{\n\t\t\"title\": \"Le Coucou (1980)\",\n\t\t\"sub\": \"Video (Movie), 800Mb, Seed: 10, Leech: 20\",\n\t\t\"icon\": \"imgs/icon.png\",\n\t\t\"selected\": true\n\t}, {\n\t\t\"title\": \"Vol au dessus d'un nid de coucou.French DVDRip [Sheraff]\",\n\t\t\"icon\": \"imgs/icon.png\"\n\t}]\n}\n```\n\n- `callback`: function to be called when this state is displayed (only when reading the script with `play_script()`, ignored when using `echo_state()`). Send the index of the state as an argument.\n```\n// Example\n\"callback\": my_function\n```\n\n## how to play the script \u003ca id=\"playing\"\u003e\u003c/a\u003e\nThere are 2 functions that allow you to use what you scripted:\n- `echo_state(state)` put the simulation in the provided state. If some notification / key modifiers were on the screen, they will fade away normally unless replaced by the provided state.\n```\n// Example\necho_state(script[0]) //to put in initial position\n```\n- `play_script(script, from, to, loop, start_at)` will take care of playing the whole script based on the given parameters:\n  - `script` is the script you want to follow\n  - `from` (defaults to `0`) is the first state to be displayed, \n  - `to` (defaults to `0`) is the last+1 (use `0` or `script.length` to play the whole script)\n  - `loop` (defaults to `true`) is a boolean to indicate whether or not to go back to (`from`) when `to` is reached\n  - `start_at` (defaults to the value of `from`) is where the playhead starts at\n```\n// Examples\nplay_script(script) //play and loop the whole script\nplay_script(script, 3) //play and loop the whole script except frames 0, 1 and 2\nplay_script(script, 2, 5, false) //play frames 2, 3, 4 and stop \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSheraff%2Falfred-workflow-mockup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSheraff%2Falfred-workflow-mockup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSheraff%2Falfred-workflow-mockup/lists"}