Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
File Operations
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
File Operations
Starting a new topic. Will be allocated for the support and discussion about plugin File Operation. The plugin was established on the basis of discussions in the topic viewtopic.php?f=5&t=732.
Plugin has two actions. Read from a text file and Write to a text file.
Dialog of action Read is as follows: Dialog of action Write is as follows: If are these two actions one after another, can be used for recoding a file.
Please help:
1) Check please the functionality of the plugin.
2) Please check the English strings in dialogues
and possibly design a better versions.
3) Please any suggestions for a apposite icon.
Thanks !
Pako
The latest version you can always find here.
EDIT 11-04-2011: download link changed
Plugin has two actions. Read from a text file and Write to a text file.
Dialog of action Read is as follows: Dialog of action Write is as follows: If are these two actions one after another, can be used for recoding a file.
Please help:
1) Check please the functionality of the plugin.
2) Please check the English strings in dialogues
and possibly design a better versions.
3) Please any suggestions for a apposite icon.
Thanks !
Pako
The latest version you can always find here.
EDIT 11-04-2011: download link changed
- Bitmonster
- Site Admin
- Posts: 2239
- Joined: Mon Feb 06, 2006 10:28 pm
Re: File Operations
I think you can add it to the SVN trunk.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: File Operations
Thanks - done.Bitmonster wrote:I think you can add it to the SVN trunk.
Pako
-
jsonnabend
- Experienced User
- Posts: 127
- Joined: Wed Apr 23, 2008 7:35 pm
Re: File Operations
Pako, to where does the plugin read? Is there an array variable that holds the text lines?
- Jeff
- Jeff
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: File Operations
In the case of a single reading (action "Read text from file"), the obtained lines are returned as a list in eg.result.
In the case of periodical reading (action "Start periodical reading"), then obtained lines are available as an event payload (also in the form of the list of lines).
Is the answer clear?
Pako
In the case of periodical reading (action "Start periodical reading"), then obtained lines are available as an event payload (also in the form of the list of lines).
Is the answer clear?
Pako
-
jsonnabend
- Experienced User
- Posts: 127
- Joined: Wed Apr 23, 2008 7:35 pm
Re: File Operations
Got it. Thanks, Pako.
- Jeff
- Jeff
-
yakovyarmo
- Posts: 18
- Joined: Mon Jul 27, 2009 12:01 am
Re: File Operations
i changed the script and added the option to trigger an event if the file hasn't changed.
should i post the new plugin here?
should i post the new plugin here?
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: File Operations
@yakovyarmo,
I had not thought that someone would need such a function. But I see, that so.
Of course, I can implement myself, but I was also interested in your solution.
Pako
I had not thought that someone would need such a function. But I see, that so.
Of course, I can implement myself, but I was also interested in your solution.
Pako
Not able to pass variables to File Operations Output field
Hi all,
Windows 7, x64, Eventghost 3.7 r1486.
How can I pass the value contained within a variable to the standard File Operations plugin, specifically to the the File Operations Write Text to File Action's output file field?
If you hardcode a location, it will write to a file:

When you put in a variable, it does not:

Here are the log contents - I've pointed out where passing the variable's contents doesn't work:

Here's the XML:
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1486">
<Folder Name="test" Expanded="True">
<Macro Name="test" Expanded="True">
<Action>
EventGhost.PythonCommand(u'newFile= "C:\\test.txt"')
</Action>
<Action>
FileOperations.Write(2, u'{eg.result}', u'C:\\test.txt', 2, 0, False, False, False, 'cp1252')
</Action>
<Action>
EventGhost.PythonCommand(u'print "That appended something- even if None to that the test file"')
</Action>
<Action>
FileOperations.Write(2, u'{eg.result}', u'{newFile}', 2, 0, False, False, False, 'cp1252')
</Action>
<Action>
EventGhost.PythonCommand(u'print "That did not append anything to the test file"')
</Action>
</Macro>
</Folder>
</EventGhost>
Thank you!
Windows 7, x64, Eventghost 3.7 r1486.
How can I pass the value contained within a variable to the standard File Operations plugin, specifically to the the File Operations Write Text to File Action's output file field?
If you hardcode a location, it will write to a file:

When you put in a variable, it does not:

Here are the log contents - I've pointed out where passing the variable's contents doesn't work:

Here's the XML:
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1486">
<Folder Name="test" Expanded="True">
<Macro Name="test" Expanded="True">
<Action>
EventGhost.PythonCommand(u'newFile= "C:\\test.txt"')
</Action>
<Action>
FileOperations.Write(2, u'{eg.result}', u'C:\\test.txt', 2, 0, False, False, False, 'cp1252')
</Action>
<Action>
EventGhost.PythonCommand(u'print "That appended something- even if None to that the test file"')
</Action>
<Action>
FileOperations.Write(2, u'{eg.result}', u'{newFile}', 2, 0, False, False, False, 'cp1252')
</Action>
<Action>
EventGhost.PythonCommand(u'print "That did not append anything to the test file"')
</Action>
</Macro>
</Folder>
</EventGhost>
Thank you!
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: File Operations
Please do not create unnecessary new topics!
To support File operations plugin is designed just this topic.
Yes, in the edit-box Output file was not possible to use python expression.
I added this option. Before the release of new version EG, you can download the modified version of plugin.
Link to download you can find in the first post of this topic.
Pako
To support File operations plugin is designed just this topic.
Yes, in the edit-box Output file was not possible to use python expression.
I added this option. Before the release of new version EG, you can download the modified version of plugin.
Link to download you can find in the first post of this topic.
Pako
- InterlinkKnight
- Posts: 29
- Joined: Mon Sep 13, 2010 1:17 am
- Contact:
Re: File Operations
I am searching for something that allow me to read a line in a text and create an event when a specific word is there. This plug in allow this?
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: File Operations
Of course, it's very simple:Pako
Re: File Operations
First off, I have to admit that I am a complete EG newbie and struggling big time with its steep learning curve.Pako wrote:In the case of a single reading (action "Read text from file"), the obtained lines are returned as a list in eg.result.
In the case of periodical reading (action "Start periodical reading"), then obtained lines are available as an event payload (also in the form of the list of lines).
Is the answer clear?
Pako
I am trying to periodically read out certain lines of a file and broadcast the result.
I have been progressing in baby steps:
* I got the part working which extracts the data I want - from both, a periodically and one-time read out
* I can print the result of the one-time read out (=> print eg.result). I was thinking of using the print command for the time being till I get the File module properly working, i.e. before I 'graduate' to the Broadcasting part.
Here is where I got stuck:
*I cannot print the result of a periodical readout.
*I cannot get the broadcasting part working for either, periodically or one-time. I am not clear what to put in under 'Observations and event name' in the File Operations module, not under 'Command' and 'Payload' in the Broadcaster module.
I have been searching here and the web for documentation, but thus far found only rather limited information.
Any advise would be greatly appreciated.
Thanks!
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: File Operations
When you use the action "Start periodical reading", so you can not print eg.result. This action does not result, this action only starts the periodic reading.
Content (or certain lines) of file you can only receive as eg.event.payload.
You certainly do not need to actually print the "result".
Perhaps it would be better to write exactly what you need.
Pako
Content (or certain lines) of file you can only receive as eg.event.payload.
You certainly do not need to actually print the "result".
Perhaps it would be better to write exactly what you need.
Pako