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.

Action "open file"?

If you have a question or need help, this is the place to be.
Post Reply
danyreus
Posts: 3
Joined: Sat Feb 20, 2010 8:52 am

Action "open file"?

Post by danyreus »

Hi, I checked forum and couldn't find this. Is there an action to open any file? I could find close and start program, but is there any chance to open m3u file by pressing one button? I'm using eventghost 0.3.7.r1194. Otherwise it's a great program, thanks!!!
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Action "open file"?

Post by Bartman »

normally you would launch a program and pass the file as a parameter. Depending on the player there might even be a specialised plugin allowing to do that.
You could write a script that triggers the os for the default application but in almost any case you know what program you want.
danyreus
Posts: 3
Joined: Sat Feb 20, 2010 8:52 am

Re: Action "open file"?

Post by danyreus »

Normally in winxp I just double click on m3u file and it starts playing automatically in winamp. Just wondering would be possible to do the same action with Eventghost. I can start winamp (action: "start application"), but it wouldn't start playing that particular m3u file. Is there any action available witch simply opens file, the same way as it does with applications?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Action "open file"?

Post by Pako »

Code: Select all

#Python script open file
from os import startfile
myFile = u"D:\\Data\\MP3\\SomeArtist\\SomePlaylist.m3u"
startfile(myFile)
or

Code: Select all

#Python script open file
from os import startfile
startfile(eg.result)
or

Code: Select all

#Python script open file
from os import startfile
startfile(eg.event.payload)
etc.

Pako
danyreus
Posts: 3
Joined: Sat Feb 20, 2010 8:52 am

Re: Action "open file"?

Post by danyreus »

It's working!!! :))) Thanks a lot, Pako! Brilliant!
Post Reply