dupa

Author Topic: need some help with a mediaOpener plug in  (Read 3945 times)

sybershot

  • Hero Member
  • *****
  • Posts: 787
    • View Profile
need some help with a mediaOpener plug in
« on: October 07, 2011, 03:10:30 pm »
here is what I am trying to do, I used a smaller version of this plug in along time ago but only used it to open mp3's and flv's. I lost all my files due to a corrupt portable drive.  I would like to expand a bit further than what I did before, for it is very useful and I think it would make a great addition to our hals.

working media opening plug in commands
play the song "song name" = plays mp3
play the music video "song name" = plays flv's 
play the movie "movie name" = plays wmv's .mov and other extensions
show the picture "picture name" = opens jpeg, giff, png

note: atm you can also say "play the song "picture name"" if png format it will open the picture. kinda funny

the only extensions I tested that work atm are mp3's, flv's and png's
giff, jpeg's do not work
I have not tested the following extensions avi, mov, mp4, mpg, wmv

I also tried to add commands and extensions for the following(not in uploaded plug in)
"show the book "books name" = opens a pdf: But hal did not like me using the word book  :(
"show the document "documents name" = opens txt file: but hal did not like me using using the word document
I also could not get hal to open a pdf or txt  with working commands like "play the song "name of pdf or txt""

 I really would like to be able to open jpg's, any help with that would be greatly greatly appreciated.
the other extensions (giff,avi, mov, mp4, mpg, wmv) I think would be useful for other members, it is why I included them. just have not been able to test them all yet. pdf's and txt's  would be great a great asset for for me and others in this plug in but I could not get them to work  :(

if some one is able to help don't forget to add your name for credit: original credit goes to Steele

sybershot

  • Hero Member
  • *****
  • Posts: 787
    • View Profile
Re: need some help with a mediaOpener plug in
« Reply #1 on: October 08, 2011, 02:11:06 pm »
Sorry forgot to post the site below where Steele gives directions on how to use the plug in
 http://www.ultrahal.com/community/index.php?topic=5323.msg32725#msg32725

also wile testing and using Hal always ask me at the end to use complete sentences, is there a way to have Hal stop telling me this?

HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
Re: need some help with a mediaOpener plug in
« Reply #2 on: October 17, 2011, 06:27:09 pm »
Simple fix for the jpg and gif files. In your script, you forgot to capitalize "JPG" and "GIF" (ie. UCase(Right(File, 3)) = "jpg" should be UCase(Right(File, 3)) = "JPG").

For the issue with Hal responding, from what I see in the coding the loaded script is run but then the main Hal brain is continued from where the script was dynamically loaded (the "PLUGINAREA#" used). This would mean Hal will respond as usual to the commands being run in your script. When I used to make plugins for Hal (years ago now) I would have to test them by inserting the code directly into the main Hal brain. I actually like this new method of the PLUGINAREA# code insertion, but this still doesn't give control over the rest of the main brain. My first goal with getting back into development with Hal will be to re-write the brain code a bit to allow for some over-riding of the other brain functions when a custom script is performed.


Happy coding!
Living life with a loving heart, peaceful mind, and bold spirit.

HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
Re: need some help with a mediaOpener plug in
« Reply #3 on: October 17, 2011, 06:49:19 pm »
P.S. I quickly tried your code with .pdf and .doc files and it works fine (after I added the appropriate extension searching in the ReadFolder function). Maybe your issue lies with Windows and the default application it uses?
Living life with a loving heart, peaceful mind, and bold spirit.

sybershot

  • Hero Member
  • *****
  • Posts: 787
    • View Profile
Re: need some help with a mediaOpener plug in
« Reply #4 on: October 17, 2011, 07:43:45 pm »
Quote
Simple fix for the jpg and gif files. In your script, you forgot to capitalize "JPG" and "GIF" (ie. UCase(Right(File, 3)) = "jpg" should be UCase(Right(File, 3)) = "JPG").

I did try uppercase extensions before I uploaded the plug-in, the lowercase extensions are do to a save before I uploaded.

Quote
P.S. I quickly tried your code with .pdf and .doc files and it works fine (after I added the appropriate extension searching in the ReadFolder function). Maybe your issue lies with Windows and the default application it uses?

 8) thanks a million, I believe this may also be for the issue with gifs and jpegs as well. I will have to test and see

Quote
When I used to make plugins for Hal (years ago now) I would have to test them by inserting the code directly into the main Hal brain.
I read that people had to do that back in the day, the use of plug-ins is a nice feature that make it easy for many users. It would probably helped me learn vb and more of how Hal actually works if I was to go into Hals brain, but I have not ventured that far yet. maybe someday soon. I have a few small 3D flash projects to work on, maybe after I complete them :)

thanks again for your wisdom Sincerely SyberShot