Unlocker w/ Sound

Discuss and share scripts and script files...
Post Reply
stanmarsh
Posts: 85
Joined: 10 Mar 2009 07:43

Unlocker w/ Sound

Post by stanmarsh »

Unlocker, unlocks the file in use by another program or user. :D

Code: Select all

//Unlocker 0.1

"Unlock : unlock"
    //set Unlocker path below 
    $_exec = "<xypath>\Unlocker\UnlockerPortable.exe";
	openwith """$_exec"" <items>", m;
just a minor update to unlocker script, i use -s to hide the GUI and added a sound notification using microwav.

requirements:
program - http://bellsouthpwp2.net/b/o/bobad/microwav.htm by MacGyver_Soft
sound file - C:\WINDOWS\Media\chimes.wav
PFA - *.wav>microwav.exe

Code: Select all

//Unlocker 0.2
//-s: Unlock object without showing GUI

"Unlock : unlock"
    //set Unlocker and Sound path below 
    $_exec = "<xypath>\Unlocker\UnlockerPortable.exe";
	$_wav = "<xypath>\chimes.wav";
    
	openwith """$_exec"" <items> -s", m;
   open "$_wav";
Last edited by stanmarsh on 07 Dec 2009 08:41, edited 2 times in total.

ramza__x
Posts: 84
Joined: 06 Oct 2007 02:21
Location: Australia

Re: Unlocker

Post by ramza__x »

Thank you!
Confirmed, it works!
(just tell the newbie to change the path)
Windows XP Pro (SP3) (x86)
1680x1050 Res /120 DPI, Acer Laptop

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Unlocker

Post by zer0 »

Couple of questions:
a) Why are you defining the path variable as 'global'?
b) Why quote a path separately instead of a straight forward

Code: Select all

openwith """<xypath>\Unlocker\UnlockerPortable.exe"" <items>", m;
Don't get the impression that I'm knocking down your effort, simply curious :wink:
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

stanmarsh
Posts: 85
Joined: 10 Mar 2009 07:43

Re: Unlocker

Post by stanmarsh »

hello zero,

thank you for the suggestion :) , your way is much better, i'm actually just learning how to script. i removed the global now and replaced it with a comment, and i separated the path because it looks much cleaner.

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Unlocker

Post by zer0 »

stanmarsh wrote:thank you for the suggestion :) , your way is much better, i'm actually just learning how to script. i removed the global now and replaced it with a comment, and i separated the path because it looks much cleaner.
Everyone has their habits when it comes to scripting. When you're learning, it's good to break things down, because that would provide an easier way to comprehend. If you get more serious with scripting/programming then you'd come across a concept called 'refactoring', aka tidying up the code, a result of which is that one-line script that I mentioned.

Always happy to help ;)
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

Post Reply