Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sure! It's as simple as running the system command "osascript" and passing in the file here:

https://github.com/pcottle/emotiface/blob/master/backend/key...

As you can see, it just keeps hitting return 20 times (for 20 packets). The JS does the majority of the heavy lifting. It continually checks the chat textarea and waits for it to empty (when a keydown happens). When that happens, it loads the next packet and waits again. Code snippet:

//check if it's nothing

    console.log('waiting for next return key');

    var theVal = $j('.fbNubFlyoutInner').find('textarea').val();

    console.log(theVal);

    if(theVal)
    {

        //need to wait

        var timeoutStr = "keydownCheck('" + filename + "'," + String(numPacket) + ");";

        setTimeout(timeoutStr,keydownSleep);

        return;
    }

    //actually put the next packet in

    var packetText = JSON.stringify(files[filename].packetMap[numPacket]);

    $j('.fbNubFlyoutInner').find('textarea').val(packetText);

Link:

https://github.com/pcottle/emotiface/blob/master/backend/sta...



Thanks, this will help out with a hackety thing I've been wanting to do.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: