What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Release] Voice Clip Sender

Pages: (6): « First « 1 [ 2 ] 3 4 5 6 » Last »
1 votes - 5 average   [Release] Voice Clip Sender
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: RE: [Release] Voice Clip Sender
quote:
Originally posted by deAd
The language changes affect the path to the Custom Sounds
ermm.. no it doesn't... if it does then you take a totally wrong approach in getting the directory.

Moreover, the custom sound directory isn't always located in application directory under "documents and settings" directory either, but can be located in a subdirectory of the Messenger Plus! directory under "program files"!...

I didn't took a look at your script, but never ever hard code a path. Second, never ever use the "Special Folders" registry key to get to special folders like "Documents and settings". Never ever use environment variables to get to it. What you should do is using Windows API like SHGetSpecialFolderPath and the likes.

EDIT: after reading your post further I see you indeed hard coded the path. This is the worst method you can do actually (even reading the special folders key in the registry is a better method than that).

This post was edited on 12-22-2006 at 12:06 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-21-2006 11:59 PM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. RE: RE: RE: RE: [Release] Voice Clip Sender
quote:
Originally posted by CookieRevised
quote:
Originally posted by deAd
The language changes affect the path to the Custom Sounds
ermm.. no it doesn't... if it does then you take a totally wrong approach in getting the directory.

Moreover, the custom sound directory isn't always located in the "documents and settings" directory either...

I didn't took a look at your script, but never ever hard code a path. Second, never ever use the "Special Folders" registry key to get to special folders like "Documents and settings". Never ever use environment variables to get to it. What you should do is using Windows API like SHGetSpecialFolderPath and the likes.

EDIT: after reading your post further I see you indeed hard code the path. This is the worst method you can do actually (even reading the special folders key in the registry is a better method than that).

I did hard code the path, I hadn't thought of using the script in different languages. Also, when would the path to the Custom Sounds change? AFAIK they're always in the same directory.
12-22-2006 12:02 AM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. RE: RE: [Release] Voice Clip Sender
quote:
Originally posted by CookieRevised
quote:
Originally posted by deAd
I did hard code the path, I hadn't thought of using the script in different languages. Also, when would the path to the Custom Sounds change? AFAIK they're always in the same directory.
it doesn't change after you've installed Plus!... but it is not always the same for everybody when they first install Plus!.

What would make the path change during the installation?
12-22-2006 12:08 AM
Profile PM Find Quote Report
Ace-_Ventura
New Member
*


Posts: 7
Joined: Dec 2006
RE: [Release] Voice Clip Sender
thanks, it's working now :D. Great script I must say
12-22-2006 12:09 AM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Release] Voice Clip Sender
quote:
Originally posted by deAd
I did hard code the path, I hadn't thought of using the script in different languages. Also, when would the path to the Custom Sounds change? AFAIK they're always in the same directory.
1) It is not always the same (as in a subdir under the application directory) for everybody when they first install Plus!.
2) _every_ directory under Documents and settings (including documents & settings itself) can be renamed and moved by the Windows user.


And even if nothing changed, you must never ever hard code a path.

This post was edited on 12-22-2006 at 12:11 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-22-2006 12:10 AM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. RE: RE: [Release] Voice Clip Sender
quote:
Originally posted by CookieRevised
1) It is not always the same (as in a subdir under the application directory) for everybody when they first install Plus!.
2) _every_ directory under Documents and settings (including documents & settings itself) can be renamed and moved by the Windows user.


And even if nothing changed, you must never ever hard code a path.

I have changed the code to get the path using SHGetFolderPath. It will be changed in the next update :). I have not accounted for (1) yet, and imo (2) is pretty unlikely -- wouldn't that screw up Plus! as well?
12-22-2006 12:17 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: RE: [Release] Voice Clip Sender
quote:
Originally posted by deAd
quote:
Originally posted by CookieRevised
1) It is not always the same (as in a subdir under the application directory) for everybody when they first install Plus!.
2) _every_ directory under Documents and settings (including documents & settings itself) can be renamed and moved by the Windows user.


And even if nothing changed, you must never ever hard code a path.

I have changed the code to get the path using SHGetFolderPath. It will be changed in the next update :). I have not accounted for (1) yet, and imo (2) is pretty unlikely -- wouldn't that screw up Plus! as well?

this still isn't correct....

The proper and only correct way to get to the custom sound dir is using the exact same method as Plus! uses, which is:
1) get the APPDATA path by using the SHGetSpecialFolderLocation (with CSIDL_COMMON_APPDATA) and SHGetPathFromIDList APIs
2) If no path is returned or those functions fail, get Plus!'s installation directory from the registry, and append the subdirectory "Data" to it.
3) Only after doing all that, you can append the directory "Messenger Plus!\Custom Sounds" to the path you get from 1 or 2.

^^ trade secret here? :D;)

quote:
Originally posted by deAd
wouldn't that screw up Plus! as well?
no as Plus! uses proper methods to get paths like "documents and settings", "program files", etc, etc... it uses the SHGetSpecialFolderPath , SHGetSpecialFolderLocation, SHGetPathFromIDList, etc APIs like every program should (and does).

;)

This post was edited on 12-22-2006 at 12:58 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-22-2006 12:28 AM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. RE: RE: RE: RE: [Release] Voice Clip Sender
quote:
Originally posted by CookieRevised
quote:
Originally posted by deAd
quote:
Originally posted by CookieRevised
1) It is not always the same (as in a subdir under the application directory) for everybody when they first install Plus!.
2) _every_ directory under Documents and settings (including documents & settings itself) can be renamed and moved by the Windows user.


And even if nothing changed, you must never ever hard code a path.

I have changed the code to get the path using SHGetFolderPath. It will be changed in the next update :). I have not accounted for (1) yet, and imo (2) is pretty unlikely -- wouldn't that screw up Plus! as well?

this still isn't correct....

...

no as Plus! uses proper methods to get paths like "documents and settings", "program files", etc, etc... it uses the SHGetSpecialFolderPath , SHGetSpecialFolderLocation, SHGetPathFromIDList, etc APIs like every program should (and does).

;)

SHGetFolderPath supercedes SHGetSpecialFolderPath, and accepts the same CSIDL as SHGetSpecialFolderPath. What's wrong with it? I'll add the other steps too.
12-22-2006 12:49 AM
Profile PM Find Quote Report
Grue
Full Member
***


Posts: 120
Reputation: 6
– / Male / –
Joined: Jun 2004
RE: [Release] Voice Clip Sender
Wow, I really like this script. It works well.
Just one question- Is there any way to adjust the volume level of the voice clip?
Thanks!
12-22-2006 07:04 AM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: [Release] Voice Clip Sender
This script's great! It looks, feels and works great! :D The sound of my speakers isn't that good, so the sound's quality is a bit less but it's an awesome way to send people who don't use Plus! a custom sound. Maybe Patchou should use voice clips as alternative for the Emotion Sounds? :)

Both thumbs up! (y)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
12-22-2006 09:32 AM
Profile E-Mail PM Web Find Quote Report
Pages: (6): « First « 1 [ 2 ] 3 4 5 6 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On