Posts Tagged ‘shortcuts’

h1

Evernote Keyboard Shortcuts

09/01/2010

I was going to spend some time today compiling a list of keyboard shortcuts for Evernote.  I’d had a look around some time ago and been unable to find much out there, but before I began I thought I’d have another check.  This time I found a link to a PDF on site mistywindows.com that does a superb job of describing the available shortcut keys.

Advertisements
h1

Shortcuts with VB Script

18/07/2009

Sometimes I need to create shortcuts with VB Script especially if the script is being installed and a shortcut needs to be created to the script.  The code to create a shortcut is quite straight forward,  but the CreateShortcut() function presented here pulls everything together into a single reusable form.  Optional parameters that you don’t want to use can be filled by the use of “NULL” and environment variables can be included in file paths to make this as flexible as possible.

Option Explicit

CreateShortcut "%UserProfile%\SendTo\Test Link.lnk", _
 "C:\Scripts\Test-Script.vbs", NULL, "A test script", NULL, NULL, NULL, NULL, NULL

Function CreateShortcut(p_strShortcutPath, p_strTargetPath, _
 p_strArguments, p_strComment, _
 p_strHotKey, p_strIconPath, p_strIconPosition, _
 p_strWindowStyle, p_strWorkingDirectory)

 'Example Parameters
 'p_strShortcutPath = "%UserProfile%\SendTo\Shortcut to Something"
 'p_strTargetPath = "%PROGRAMFILES%\Somewhere\Something.exe"
 'p_strArguments = "/O"
 'p_strDescription = "Start Something"
 'p_strHotKey = "CTRL+ALT+Q"
 'p_strIconPath = "%PROGRAMFILES%\Somewhere\Something.exe"
 'p_strIconPosition = "3"
 'p_strWindowStyle = "1"
 'p_strWorkingDirectory = "C:\Working\"
 'Use NULL for parameters which are not to be set

 Dim objShell, objShortcut

 Set objShell = WScript.CreateObject("WScript.Shell")
 Set objShortcut = objShell.CreateShortcut(objShell.ExpandEnvironmentStrings(p_strShortcutPath))

 If Not isNull(p_strTargetPath) Then
 objShortcut.TargetPath = objShell.ExpandEnvironmentStrings(p_strTargetPath)
 End If

 If Not isNull(p_strArguments) Then
 objShortcut.Arguments = p_strArguments
 End If

 If Not isNull(p_strComment) Then
 objShortcut.Description = p_strComment
 End If

 If Not isNull(p_strHotKey) Then
 objShortcut.HotKey = p_strHotKey
 End If

 If Not isNull(p_strIconPath) Then
 objShortcut.IconLocation = objShell.ExpandEnvironmentStrings(p_strIconPath & ", " & p_strIconPosition)
 End If

 If Not isNull(p_strWindowStyle) Then
 objShortcut.WindowStyle = p_strWindowStyle
 End If

 If Not isNull(p_strWorkingDirectory) Then
 objShortcut.WorkingDirectory = objShell.ExpandEnvironmentStrings(p_strWorkingDirectory)
 End If

 objShortcut.Save
End Function