This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Scripting DBUS with bash: how to handle QDBusRawType

Tags: None
(comma "," separated)
geolours
Registered Member
Posts
14
Karma
0
OS
Hello,

I think i have the same problem like this one

I'm trying to write a script that inserts text into a document being edited from Kate

I've tried
Code: Select all
$ num=$(qdbus `qdbus | grep kate` /DocumentManager org.kde.Kate.DocumentManager.documents)

$ qdbus `qdbus | grep kate` /Kate/Document/$num |grep insertText                           
method bool org.kde.KTextEditor.Document.insertText(QDBusRawType::(ii cursor)
method bool org.kde.KTextEditor.Document.insertTextLines(QDBusRawType::(ii cursor)

Like f1r3br4nd, I've tried
Code: Select all
$ qdbus `qdbus | grep kate` /Kate/Document/$num org.kde.KTextEditor.Document.endOfLine 22
qdbus: I don't know how to display an argument of type '(ii)', run with --literal.

so
Code: Select all
$ qdbus --literal `qdbus | grep kate` /Kate/Document/$num org.kde.KTextEditor.Document.endOfLine
[Argument: (ii) 93, 22]


but if i try

Code: Select all
$ qdbus `qdbus | grep kate` /Kate/Document/$num org.kde.KTextEditor.Document.cursorInText 93 22 "$string"

Cannot call method 'cursorInText' because type 'QDBusRawType::(ii' is unknown to this tool


Which is thus the good syntax ?

Just another question : how can I get the cursor position in kate with qdbus ?

regards,

Geo


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]