{"action":"created","issue":{"url":"https://api.github.com/repos/cereda/arara/issues/69","labels_url":"https://api.github.com/repos/cereda/arara/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/cereda/arara/issues/69/comments","events_url":"https://api.github.com/repos/cereda/arara/issues/69/events","html_url":"https://github.com/cereda/arara/issues/69","id":88746894,"number":69,"title":"finished.yaml","user":{"login":"cmhughes","id":2224480,"avatar_url":"https://avatars.githubusercontent.com/u/2224480?v=3","gravatar_id":"","url":"https://api.github.com/users/cmhughes","html_url":"https://github.com/cmhughes","followers_url":"https://api.github.com/users/cmhughes/followers","following_url":"https://api.github.com/users/cmhughes/following{/other_user}","gists_url":"https://api.github.com/users/cmhughes/gists{/gist_id}","starred_url":"https://api.github.com/users/cmhughes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmhughes/subscriptions","organizations_url":"https://api.github.com/users/cmhughes/orgs","repos_url":"https://api.github.com/users/cmhughes/repos","events_url":"https://api.github.com/users/cmhughes/events{/privacy}","received_events_url":"https://api.github.com/users/cmhughes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-16T14:41:26Z","updated_at":"2015-06-16T16:24:41Z","closed_at":null,"body":"Hello to the `arara` team!\r\nThanks for creating & maintaining such a great tool, it's a vital part of my workflow both at work and at home :)\r\n\r\nI'm currently working on a project that has a lot of images, and as a result takes quite a long time to produce a `pdf` (approximately 10 minutes); as such, I like to leave it running in the background. Rather than checking it regularly, I thought that I would create a little 'pop up' rule that tells me when it has finished. As such, I have the following (the following demonstrates a Windows implementation):\r\n\r\n```\r\n% arara: latex\r\n% arara: latex\r\n% arara: dvips\r\n% arara: ps2pdf\r\n% arara: finished\r\n```\r\nwhere `finished.yaml` looks like this:\r\n\r\n```YAML\r\n!config\r\n# long tasks can run in the background;\r\n# this rule launches the finished.bat file\r\n# which should bring up a DOS prompt\r\n# author: Chris Hughes\r\n# requires arara 3.0+\r\n#\r\n# Sample usage\r\n#\r\n# % arara: finished\r\n#\r\nidentifier: finished\r\nname: finished\r\ncommands: \r\n- <arara> cmd /c start cmd /C finished.bat @{file}\r\narguments: [] \r\n```\r\n\r\nand `finished.bat` contains\r\n\r\n```Batchfile\r\necho off\r\nREM This is a small file to help me when compiling large \r\nREM LaTeX documents, e.g the MST125 units; it is called \r\nREM arara using the finished.yaml rule. It simply brings \r\nREM a DOS prompt to the front of my screen telling me it is\r\nREM finished.\r\nREM This saves me from having to watch it\r\ntitle finished! %1\r\nFor /f \"tokens=1-3 delims=/ \" %%a in ('date /t') do (set mydate=%%b-%%a-%%c)\r\nFor /f \"tokens=1-2 delims=/:\" %%a in (\"%TIME%\") do (set mytime=%%a.%%b)\r\necho finished working on %1\r\necho \r\nfor /l %%i in (1,1,3) do echo time stamp: %mytime%, %mydate%\r\npause\r\n```\r\n\r\nI don't think my implementation is ideal/optimal, but I wondered if it might inspire a better/more robust idea from the `arara` development team?\r\n\r\nChris :)\r\n\r\nPS: this isn't really an issue, but I wasn't sure where it would best be placed..."},"comment":{"url":"https://api.github.com/repos/cereda/arara/issues/comments/112487484","html_url":"https://github.com/cereda/arara/issues/69#issuecomment-112487484","issue_url":"https://api.github.com/repos/cereda/arara/issues/69","id":112487484,"user":{"login":"cmhughes","id":2224480,"avatar_url":"https://avatars.githubusercontent.com/u/2224480?v=3","gravatar_id":"","url":"https://api.github.com/users/cmhughes","html_url":"https://github.com/cmhughes","followers_url":"https://api.github.com/users/cmhughes/followers","following_url":"https://api.github.com/users/cmhughes/following{/other_user}","gists_url":"https://api.github.com/users/cmhughes/gists{/gist_id}","starred_url":"https://api.github.com/users/cmhughes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmhughes/subscriptions","organizations_url":"https://api.github.com/users/cmhughes/orgs","repos_url":"https://api.github.com/users/cmhughes/repos","events_url":"https://api.github.com/users/cmhughes/events{/privacy}","received_events_url":"https://api.github.com/users/cmhughes/received_events","type":"User","site_admin":false},"created_at":"2015-06-16T16:24:41Z","updated_at":"2015-06-16T16:24:41Z","body":"Hi Paulo,\nThanks so much for the very speedy response! I knew that you would have\nideas, and they all sound great. There's no worries about implementing it\nin the current version, and indeed no need to rush it into v4.0, I'll keep\nan eye out to see what you all think about it :)\n\nFeel free to close this issue if you like, now that the seed has been\nplanted.\n\nCheers\n\nChris\n\n\n\nOn Tuesday, June 16, 2015, Paulo Cereda <notifications@github.com> wrote:\n\n> Hello, Chris! [image: :smiley:]\n>\n> I have good and bad news.\n>\n> *Good news:* it is, in fact, quite straightforward to make arara trigger\n> a message box using Java's JOptionPane. Something along these lines would\n> do the trick:\n>\n> !configidentifier: finishedname: finishedcommands: - <arara> @{ javax.swing.JOptionPane.showMessageDialog(null, \"Yay, arara has finished the job!\"); \"\" }arguments: []\n>\n> As showMessageDialog does not return any values, I have to force the\n> evaluation to bring an empty string in the end as result, but it is just a\n> technical detail, do not worry with it. [image: :smiley:]\n>\n> When running this rule, you will get a lovely message box:\n>\n> [image: message]\n> <https://cloud.githubusercontent.com/assets/302062/8186636/c3257fda-1421-11e5-8b4a-8948c0fcd22a.png>\n>\n> *I haven't included the code calling the Swing UI manager to use the\n> system look and feel, that's why this message box does not look so nice,\n> but it does the job.*\n>\n> *Bad news:* The message box will appear before arara effectively runs any\n> system command. This is a nuisance changed in the upcoming 4.0 branch;\n> older versions evaluate expressions beforehand, then runs the resulting\n> commands as a batch. From 4.0 on, each rule is evaluated and executed on\n> the fly, which is, to some extent, along the lines of a REPL concept (read,\n> eval, print, loop).\n>\n> Sadly, there's no way of changing this behaviour in the current version of\n> arara, but our upcoming version already solves this problem. For\n> comparison, here's the very same rule ported to the new format (amongst\n> other options of the new format):\n>\n> !configidentifier: notifyname: Notifyauthors:- Chris Hughes- Paulo Ceredacommands:- name: User notification  command: >    @{        javax.swing.JOptionPane.showMessageDialog(null, \"Yay, arara has finished the job!\");        return true;    }arguments: []\n>\n> *I took the liberty of changing the rule name.*\n>\n> My test file is as follows (it calls the TeX engine and the notification):\n>\n> % arara: tex% arara: notify\n> Hello world!\\bye\n>\n> When running 4.0, I get the following output:\n>\n> [image: message]\n> <https://cloud.githubusercontent.com/assets/302062/8187097/754d93b2-1424-11e5-9a2b-868b5886d526.png>\n>\n> As expected. [image: :smiley:] When clicking the OK button, we have the\n> final output:\n>\n> [image: message]\n> <https://cloud.githubusercontent.com/assets/302062/8187122/95480fe4-1424-11e5-9602-c4557237e83f.png>\n>\n> There we go.\n>\n> Sadly, there's nothing much I could do with the current version. [image:\n> :cry:] Thankfully, I am working pretty hard on the user manual (expect a\n> huge list of improvements, corrections and features), so the new version\n> will finally shine and you will be able to do wonderful things once again. [image:\n> :smiley:]\n>\n> *Message to the team:* *(Chris, you are also part of the team, by the\n> way)* How do you like the idea of including a couple of UI methods to the\n> rule context? Like the one Chris wants to use in this example. Maybe just\n> one generic message box, whDere you can specify title, message body, width\n> and type of message (information, error, warning, etc). To the Gitter\n> chatroom <https://gitter.im/cereda/arara>, boys and girls! [image:\n> :smile:]\n>\n> All the best!\n>\n> Paulo\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/cereda/arara/issues/69#issuecomment-112475574>.\n>\n"}}