FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Closing programs

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
kinkstar
Newbie


Joined: 26 Oct 2005
Posts: 11
Location: Utrecht, the Netherlands

PostPosted: Wed Oct 26, 2005 3:10 pm    Post subject: Closing programs Reply with quote

Hey I got SC from a friend this morning and started scripting right away!
Love the simplicity of it all! but since I'm kinda new to this all... Is there a way of shutting down a program? I know its possible to boot a program but shutting it down?!

edit: I'd like to build the script myself so if you could just post the part that contains the shutting down command...
Back to top
View user's profile Send private message
kinkstar
Newbie


Joined: 26 Oct 2005
Posts: 11
Location: Utrecht, the Netherlands

PostPosted: Wed Oct 26, 2005 3:41 pm    Post subject: Reply with quote

hmmm I found some things... but it doesnt work... :S?

[code:1]
Foldername: iTunes Quit
iTunes Quit.js
iTunes Quit.xml
[/code:1]

in the XML:
[code:1]
<?xml version="1.0" encoding="utf-8"?>

<ClickerScript>
<Path>iTunes Quit.js</Path>
<Author>Marvin de Bruin</Author>
<Category>iTunes</Category>
<Description>Quits iTunes</Description>
<UUID>34467290-4624-11da-8cd6-0800200c9a66</UUID>
<Title>Quit iTunes</Title>
<Type>ClickerItem</Type>
<URL>http://clicker.salling.com</URL>
</ClickerScript>
[/code:1]

in the js:
[code:1]
var helper = new ActiveXObject("SCHelper.SECHelper");
if (helper.IsProcessRunning("iTunes.exe"))
{
var iTunes = new ActiveXObject("iTunes.Application");

try
{
iTunes.Quit();
}
catch (e) {}
}
[/code:1]



Pers. I think the "oops" is in the JS since I used the PPT quit for that one...
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Wed Oct 26, 2005 4:05 pm    Post subject: Reply with quote

Hi,

How is it not working? What if you remove the try/catch, and check the Script Log (from the tray icon menu)?

Cheers.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kinkstar
Newbie


Joined: 26 Oct 2005
Posts: 11
Location: Utrecht, the Netherlands

PostPosted: Wed Oct 26, 2005 4:36 pm    Post subject: Reply with quote

well the problem is it doesnt apear in my "more" menu of iTunes... so cant run it... but I have antoher question at the same time... how can I make extra Visuals (like a phone Icon when my phone rings...?)
made the tif named it visuals-gfx-phone.tif but the log says:
Phone is undentified

edit:
[code:1]
ShowMessage( message, Phone, -1, 10000 ); ;
[/code:1]
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Wed Oct 26, 2005 4:43 pm    Post subject: Reply with quote

The ShowMessage() API only accepts icons from an enum at this point, so you cannot do your own icons. I'll file this as a feature request.

You need to modify the iTunes script, if you want to your Quit command to show. If you open the "iTunes Remote" script, I think you'll figure out how that works.

Please don't modify the original iTunes script "in place"; instead make a copy and put in your "My Clicker Scripts" directory. You don't need to change the UUID.

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group