Skip to content

Instantly share code, notes, and snippets.

@dupontgu
Last active July 6, 2021 13:44
Show Gist options
  • Save dupontgu/e3ae585406d4ba48164eafd3b7d279ad to your computer and use it in GitHub Desktop.
Save dupontgu/e3ae585406d4ba48164eafd3b7d279ad to your computer and use it in GitHub Desktop.
ReaScript that triggers actions on IFTTT based on when you start and stop recording in Reaper
turnLightOn = "/bin/sh -c \"curl -H 'Connection: close' -i -X POST 'https://maker.ifttt.com/trigger/record_lamp_on/with/key/your_key_here'\"";
turnLightOff = "/bin/sh -c \"curl -H 'Connection: close' -i -X POST 'https://maker.ifttt.com/trigger/record_lamp_off/with/key/your_key_here'\"";
lastState = 0;
function main()
(
currentState = GetPlayState() & 4;
lastState != currentState ? (
command = currentState > 0 ? turnLightOn : turnLightOff;
ExecProcess(#result, command, 0);
lastState = currentState;
);
defer("main();");
);
main();
@HenriqueAPSilva
Copy link

Additionally, I would recommend setting this action as a "Global Startup Action" on SWS Extensions

@Lowice
Copy link

Lowice commented Jul 6, 2021

Hi can anybody help me >? im new at this ,.
I have red te above posts but I still can't get it to work in Logic Pro X on my Mac with Big sur osx

i made a connection that worked to turn the ligt on and of ,. but the code gives a syntax error .. here it is :

Creating a new MIDI engine with script

Evaluating MIDI-processing script...
Script failed to evaluate:
[JS Exception] SyntaxError: Unexpected token '('. Expected an opening '{' at the start of a function body. line:17

--- but when I change the expected symbols than is goes until Exeprocess and there I can't get any further .

Can anyone please help me ?

Thnx In advance !

@dupontgu
Copy link
Author

dupontgu commented Jul 6, 2021

@Lowice Sorry, this is not meant to work with Logic! Reaper only.
I do have a tutorial for Pro Tools here, if that helps at all: https://www.youtube.com/watch?v=q4VlN0nZlpw

I can look into Logic if I get a chance, but I don't think you'll be able to use the MIDI script engine.

@Lowice
Copy link

Lowice commented Jul 6, 2021

Oke , well there is an js script editor in logic ,. so I thought is would be possible , I hope that maybe you can help me out ! ,. thank anyway for your reply !
Greetz !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment