Blogging about Neotech 3 [ go ]
I recently opened a new blog about the upcoming Swedish role-playing game Neotech 3. Beware, it’s in Swedish: http://n3.nogo.se.
[ ] [ October 20, 2007 ] [ ] [ ]
My photo just got DUGG [ go ]
Yep, and I’m pretty excited about it, being an Digg virgin and all!
The photo is here: http://www.flickr.com/photos/ripperdoc/113641163/
read more | digg story
[ ] [ August 26, 2007 ] [ ] [ ]
Scripting iTunes: making an alarm clock [ go ]
How to script iTunes have been discussed many times before. In Mac you use AppleScript, but in Windows you can instead use the Windows Scripting Host. That means you can choose either VBScript or JavaScript!
The trouble is how to exactly go about this. Even if you know these scripting languages, how do you know which commands to send to iTunes? As I always wanted a dead simple alarm clock function using iTunes and Windows Task Scheduler, I wrote a short script that I could run each morning:
- Open your notepad or coding environment of choice. I will choose to use VBScript instead of JavaScript, mostly because most Windows installations will association .vbs files with the Windows Scripting Host, while some might have re-associated .js-files with their preferred JavaScript-editor (ok, maybe that’s not the best reason, but it should be simple no matter the language you choose). Save your file as iTunes.vbs to get syntax highlighting, if your editor supports this.
- Enter the following script:
Set objApp = CreateObject("iTunes.Application")
Set colSources = objApp.Sources
Set objSource = colSources.ItemByName("Library")
Set colPlaylists = objSource.Playlists
Set objPlaylist = colPlaylists.ItemByName("Party Shuffle")
objPlaylist.PlayFirstTrack
(above should be 6 rows only in your script)
You can change “Party Shuffle” to preferred playlist, but then you would have to wake up to the same sequence of songs every morning. You could also add a:
objApp.Shuffle = 1
in the script to turn on shuffling, but the first song will still be the same. Party Shuffle will always pick up where you last played it.
- Try the script by double-clicking it from Windows Explorer or your desktop. It should start iTunes (if not already started), and start playing. If another program opens your script, you have not associated .vbs to Windows Scripting Host. Re-associate, or create a shortcut to: “wscript.exe <your path to you script in quotes>”.
- Now, you just have to schedule your alarm clock. Go to Windows > Accessories > System Tools > Scheduled Tasks. Start it. For simplicity, put a shortcut to it on your desktop or in your task bar. Go through the “Add Scheduled Task” wizard, and point it to your script (or wscript shortcut, if you had to do one). You can easily customize the times of the schedule, to happen only on week days, every day, every other day, etc. If you have different times every day, you can add separate schedules for the same task.
- After finishing the wizard, make sure you right-click on the task and go to Properties > Settings and click “Wake the computer to run this task”. The nice thing about Task Scheduler is that it can wake up your computer to for the alarm. Yes, that is right, you can hibernate or go into standby all night (do that, it will save us from some global warming) and let the computer wake up by itself. To make sure this works smoothly, also enter your Windows password under “Run As” in Properties > Task.
- Before trusting your alarm completely, set the task (or a new copy of the task) to run a few minutes later and hibernate the computer. Then wait until the time you set to make sure it actually manages to go all the way. Different people have different programs installed, and some might theoretically stop the Task Scheduler from running. For example: IBM-Lenovos Client Security Solution will replace the Windows authentication with its own, forcing you to manually unlock the computer before any program can run :p
That should be all. You now have your iTunes alarm clock! You can, of course, do lots of other stuff. For example – if you have a program that translates any hot key to a command, you can make scripts for going to next and previous track, play/pause and similar. To get some good ideas, check this Microsoft article out. There is also some info here and here. Finally, do you have an idea for a script that none of these articles seem to describe? Download the Apple SDK, open the zip file and then open the iTunesCOMInterface.h file. Don’t be scared by all the C code – just search through it (for example, you want to activate Repeat, search for “repeat”). The name of the methods in the C code are most of the time identical to, or similar to, the commands you need to write in your script. Good luck!
[ ] [ January 17, 2007 ] [ ] [ ]
What I will miss [ go ]
With only ten days left before leaving Hong Kong, it is time to start wrapping up my experience here. When I created this blog, I was supposed to reflect – dissect – living in Hong Kong, and on some few occasions I actually did so. Now, I’ll make it easy for myself and just list what I will miss. Probably, I will not fully realize these things until much later.
- The skyscrapers, the buildings, the infrastructure, the airport, the skyline. Sweden has nothing, and I mean nothing that even compares. London seems like a village in comparison. I say it now, I can say it again – Hong Kong has the best skyline in the world.
- Public transport. Fast, efficient, cheap, clean, the Octopus card, always on time. There are basically no possible complaints against HK’s public transportation system. I thought Sweden had a good system, but… no.
- Shopping, especially the gadget shopping. Wanna do some shopping in the evening? Sure. 9 PM? Sure. 12 PM? Definately! Sunday, saturday, new year – doesn’t really matter. And although it can be confusing and hard to compare prices, there is a certain feeling to those shopping malls with loads of small stores, each crammed with gadgets, stuff, clothes or whatever. It is such an experience! And mostly, quite cheap.
- Being able to go in t-shirt from April to November/December. Sure, in the spring it is very humid, but it beats Swedish, or British, weather any time. I still can’t grasp how I will survive back in Sweden, when I am already suffering here with temperatures just dropping to 15 degrees C.
- Eating out. When a dinner costs from 20 HKD/2 Euro/20 SEK, up to 30/40, there is no point in cooking. I will have a hard time getting back to the kitchen in Sweden (either that, or coping with paying 100, at least, for a dinner). Sure, home-cooked food can taste really good, but honestly – most of the time somebody else better cook it
- The Vibe. I guess it is the same in most big cities, but seeing such alive city, going to Starbucks, shopping, seeing all cultures, business, old and new, poor and rich is the vibe, and even though Swedish cities might be alive (in the summers), they lack the range of sights, events and cultures.
- Okay, I have to admit it. The women. My wonderful girlfriend Shirley is not an exception (and she have to excuse me for this…
), but there are plenty of very stylish/cute/beautiful girls in Hong Kong. In addition, the fashion is more colorful and exciting than typical for north European fashion. “Blond, tall and sexy”, the Swedish motto, just seems boring. Luckily, Shirley will come with me to Europe, so I won’t really have anything to miss in that department.
- The campus. Waking up everyday with a view like this beats most things. And then I discovered, the Chinese University of Hong Kong has even better views! I have yet to see a Swedish campus that is even remotely beautiful.
- Traveling. Hong Kong is a perfect hub for traveling, and I have still a lot to see. Like Japan. I have seen Europe before, and even though I surely will enjoy some traveling there I will wait anxiously for the day that I can go back traveling in Asia.
- International contacts. This is essential, but nothing that is specific to Hong Kong. In an international environment you will meet people from different countries and backgrounds every day. Sure, I am not the guy that starts chatting with everyone just to know their story, but in Sweden there are, more or less, only Swedes. I will try my best to get back in the international arena, ASAP.
Of course, there are a few things I won’t miss:
- The hazy sky. A few days, Hong Kong has wonderful sky. But most days, it is either cloudy, misty or hazy. Or all of them. It partly depends on the climate, partly on the massive pollution from China. At least I can say that Sweden can get some wonderfully blue skies, and that both in winter and summer.
- Being away from friends, family and hobbies. Of course, this is not really Hong Kong’s fault, but going back to Sweden, the one most important thing is that I can get back to the people I used to spend time with and do the stuff I like – such as roleplaying or having family dinners. There were no real substitute in Hong Kong, although I met many good friends and had some fun sessions of gaming, it was always temporary.
- The apartment. Sure, it was like a palace compared to student halls, but going back to Sweden, I can look forward to my own home, my own stuff, my own design. More space to store stuff, more comfortable chairs, better kitchen, etc.
- The food culture. I have mixed feelings about this. Some Chinese food is really good, but I can probably find that food in Sweden too. However, the food I can’t find in Sweden, such as pig intestines, strange seafood, old eggs, grainy sausages, will not be missed. I have tried it, and I didn’t like it. Let’s leave it at that
[ ] [ December 23, 2006 ] [ ] [ ]
« Previous entries ·
Next entries »