tag:blogger.com,1999:blog-17552332.post8311003868506503993..comments2010-10-31T19:39:07.614+01:00Comments on dhaumann: Extending Kate with Scriptsdhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-17552332.post-37777289184401151122010-06-19T20:40:50.643+02:002010-06-19T20:40:50.643+02:00Okay, then perhaps there is a Perl, Python, or Jav...Okay, then perhaps there is a Perl, Python, or Javascript package that can handle DBUS's data-types. Then a small script can be written in one of those languages and add that to External Tools?<br /><br />There's got to be something besides C++ that can talk to DBUS properly!Alexhttps://www.blogger.com/profile/04827355172966742835noreply@blogger.comtag:blogger.com,1999:blog-17552332.post-61752536089079406292010-06-19T19:58:18.299+02:002010-06-19T19:58:18.299+02:00@Alex: no, it's not possible at the moment...@Alex: no, it's not possible at the moment...dhaumannhttps://www.blogger.com/profile/06242913572752671774noreply@blogger.comtag:blogger.com,1999:blog-17552332.post-35732391373841106222010-06-19T19:39:41.278+02:002010-06-19T19:39:41.278+02:00Is there a way to make Kate execute a command-line...Is there a way to make Kate execute a command-line script from qdbus or dbus-send? Because if there is, that's all you need for menu, toolbar, and keyboard shortcuts linking directly to command-line scripts without changing Kate at all.<br /><br />If you can send a dbus command to org.kde.kate-$KATE_PID telling it to run a script, then you can put that command into a shell script in the External Tools menu.<br /><br />Alternatively, even if the command-line functionality isn't exposed to dbus, you could write anything you want directly to the current document. The only problem is that if you want to insert content rather than replace everything, you have to give dbus argument specifying the location in the document. This is just a glorified array of (line #, col #) but it has to be a QPoint data-type for some reason and neither of the stupid command-line tools seem to be able to send these two simple pieces of data in that format.<br /><br />Imagine the scripting possibilities if only this one little technical problem were solved (or if my ignorance of an existing solution was dispelled).Alexhttps://www.blogger.com/profile/04827355172966742835noreply@blogger.comtag:blogger.com,1999:blog-17552332.post-20292766647852922342010-06-16T20:07:28.550+02:002010-06-16T20:07:28.550+02:00Hi Kevin,
binding scripts to shortcuts is indeed ...Hi Kevin,<br /><br />binding scripts to shortcuts is indeed on the todo list for a long time now.<br />To me it's still unclear how to do that best. My current idea is that you can create an action for a command line in the settings dialog. All actions are listed in the configure-shortcuts dialog, so it would appear there then.<br /><br />As a side note: There are also commands that need parameters (such as goto #line). So we need more than just bind an action+execute. We probably have to ask the script whether it needs parameters and then open the command line with the preprinted command in it. Is that a good idea?<br /><br />...thoughts welcome.<br /><br />Greetings<br />Dominik<br /><br />PS: yes, I remember you posting a patch. I don't know why it wasn't accepted anymore, maybe no one took the time to review + commit :(dhaumannhttps://www.blogger.com/profile/06242913572752671774noreply@blogger.comtag:blogger.com,1999:blog-17552332.post-60996704146392754022010-06-16T15:12:14.887+02:002010-06-16T15:12:14.887+02:00I would love to have the key-binding for scripts. ...I would love to have the key-binding for scripts. One of the things I miss so much is an easy way to raise or lower a paragraph over another (รก la ALT-CTRL up and down). <br /><br />I made a patch once for Kate but that was not pursued. I would happily write a script but no key bindings make this a lost cause. <br /><br />So I would be most grateful to anyone who can add key-bindings.<br /><br />I use Kate a lot and love it! This for me would be the icing on the cake.<br /><br />Cheers,<br /><br />KevinAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-17552332.post-76548789192377879072009-10-30T09:55:11.556+01:002009-10-30T09:55:11.556+01:00@kedadi:
Thanks :) Noone looked into application l...@kedadi:<br />Thanks :) Noone looked into application level scripting support, i.e., there is no Kross integration in the Kate application, yet. Looking at the list of the developer sprint, quite a lot of the todos there are finished. Kross integration simply isn't one of them, unfortunately. PS: We are happy for any help, of course :)<br /><br />@sergio_pistone:<br />We once chose QtScript as we wanted to have a lightweight scripting framework that has to very fast for e.g. indentation. Hence, we decided to use only one scripting language but make it work good. Both QtScript and Kross support JavaScript, so from the user's perspective it does not make any difference. At that time, we simply decided for QtScript from kjs, which was really a huge improvement in terms of developing with QtScript from the C++ side. There's not much more about it. One big plus for JavaScript is that JavaScript supports Unicode out of the box. Other languages do not necessarily do that, and all text strings in Kate are unicode.<br />Of course you can also argument with Security etc, but that was not really subject here.<br /><br />@Tempura:<br />No, there is no way executing external apps. But you name it: "the scripting-ability is just a little text-scribbling-toy". As Kate is a *text editor*, this is exactly what we want: Tools for text manipulation. And JavaScript is pretty good there.<br />It's still possible to add an API like "system.exec(...)". But so far, noone needed that.<br /><br />On the application level we want to add Kross. Then calling external apps is for free.dhaumannhttps://www.blogger.com/profile/06242913572752671774noreply@blogger.comtag:blogger.com,1999:blog-17552332.post-14201429318072327712009-10-30T08:41:01.698+01:002009-10-30T08:41:01.698+01:00Is there any way to involve external apps in scrip...Is there any way to involve external apps in scripts? I mean, javascript is nice and so, but the most powerful tools aren't available there, so without them, the scripting-ability is just a little text-scribbling-toy.Tempurahttps://www.blogger.com/profile/17698818599273290788noreply@blogger.comtag:blogger.com,1999:blog-17552332.post-51407468696521603252009-10-29T22:34:37.788+01:002009-10-29T22:34:37.788+01:00Does anybody know why QtScript is generally chosen...Does anybody know why QtScript is generally chosen over Kross for scripting (Amarok, Plasma, Kate, etc.)? I'm curious. I have not used QtScript but have added Kross support to an application without much problem (even though the docs were a bit lacking). Is supporting QtScript easier than supporting Kross? Is it related to security? Access to the Qt API?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-17552332.post-7462444804951906252009-10-29T20:28:56.058+01:002009-10-29T20:28:56.058+01:00Good job with scripting support.
An year and a ha...Good job with scripting support.<br /><br />An year and a half old page from Kate's website (http://kate-editor.org/news/development-sprint-results) points out that Kross support is a long-term goal. Is there anything going on in that direction?<br /><br />Thank you.kedadihttps://www.blogger.com/profile/06133415647815342452noreply@blogger.com