Saturday, May 15, 2010

Podcast manipulatie script


Al sinds 2005 gebruik ik Juice, nu al een paar jaar versie 2.2. Waar ik die versie vandaan heb weet ik niet meer maar op sourceforge staat nog steeds versie 2.0.
Maar goed, nadat de bestanden gedownload zijn wil ik ze eerst uniform maken.
Sommige MP3's hebben namen van meer dan 100 karakters lang.

Zoals deze van meer dan 150 tekens, waarbij de tekens in rood tracking tekens zijn:

dailysourcecode-231472-05-15-2010_pshow_352992_dopvhost_media_podshow
_com_doppl_0f98d82d4477dccd4427dc9d013759b3d0f252c2_dopsig_e2705c144
ee77c66df70c7a296d17c94.mp3

Dat vinden mijn iRivers niet zo fijn, dus breng ik die bestandsnamen terug naar maximaal 60 tekens.
Daarna maak ik de bestanden kleiner door ze naar 32kb/s mono te converteren.
De Podcasts waar ik naar luister zijn toch alleen maar gesproken woord (m.u.v. de DSC)...
Omdat Lame (bij het converteren) niet zo'n goede job doet om de podcasts allemaal even luid te laten klinken gooi ik de gekrompen bestanden door mp3gain heen. Hierdoor klinken de Podcasts allemaal even luid en hoef ik niet steeds aan de volume knopjes te zitten...
Lame verliest bij de conversie de ID3 tags, daarom kopieer ik, na de conversie, de ID3 tag van het oorspronkelijke bestand naar het nieuwe gecomprimeerde bestand.

Ik heb de programma's allemaal in "C:\Program Files\MyPrograms\" staan.
De programma's zijn:
id3.exe http://home.wanadoo.nl/squell/id3.html
lame.exe http://lame.sourceforge.net
mp3gain.exe http://mp3gain.sourceforge.net/

Processing mp3 files after downloading them with Juice.
I listen to podcasts and I want all files to be small, so I can carry many of them on my iRiver. For that reason, I reduce the file lengths to a maximum of 60 characters, then I have lame convert the files to 32kb/s mono.
In the process the ID3 tags are lost, so I resolve this by copying the ID3 tags from the original files to the reduced files. (The message from Lame.exe is: Be aware that the ID3 tag is currently lost when transcoding.)
In order to make them all sound equally loud I run them through mp3gain.

=====START PodcastScript.bat =====
@ECHO OFF

REM Move all files in TempDirectories to Temp0 directory, this can be done in Juice, but did not work for the ARGOS podcast under Win-XP as there is a >> in the path. Under Win-7, this works just fine.
REM Juice is configured to place all downloaded files in subdirectories under C:\2Podcasts\TempDirectories

REM Copy all files from the Juice temp directories to one single directory TempZero
cd C:\2Podcasts\TempDirectories
FOR /R %1 %%G IN (*.*) DO (
move "%%G" C:\2Podcasts\Temp0\
)

REM rename partially downloaded files from .mp3.partial to .mp3
REM Most partial files are actually fully downloaded, just not renamed
cd C:\2Podcasts\Temp0
FOR /R %1 %%G IN (*.partial) DO (
ren "%%G" "%%~nG"
)

REM Move mp3 files to Temp1 and then move remaining files to RemainingFiles directory
Move /Y C:\2Podcasts\Temp0\*.mp3 C:\2Podcasts\Temp1\
Move /Y C:\2Podcasts\Temp0\*.* C:\2Podcasts\RemainingFiles\

REM All active files are now in Temp1

REM Truncate filenames longer than 60 characters
setlocal EnableDelayedExpansion
cd "C:\2Podcasts\Temp1"
REM loop over all files in the cwd
for /f %%a in ('dir /a-d /b') do (
REM store this filename in a variable so we can do substringing
set ThisFileName=%%a
REM Set a filename without the extension
set ThisFileNameNOEXT=%%~na
REM now take a substring after removing the extension
set ThisShortFileName=!ThisFileNameNOEXT:~0,60!
REM finally, the rename. I use the shortfilename with an * to handle spaces in he filenames
ren !ThisShortFileName!* !ThisShortFileName!.mp3
)
:EOF
endlocal

REM All active shortnamed files are in Temp1

REM Re-encode all files to 32kbs at 32kHz sample rate from Temp1 to Temp2
REM Copy the lost ID3 Tags from the original file back to the re-encoded file.
REM ID3 is located on: http://home.wanadoo.nl/squell/id3.html
cd C:\2Podcasts\Temp1
FOR /R "C:\2Podcasts\Temp1" %1 %%G IN (*.mp3) DO (
"C:\Program Files\MyPrograms\lame.exe" -f -a -b 32 --resample 32 "%%G" "C:\2Podcasts\Temp2\%%~nxG"
"C:\Program Files\MyPrograms\id3" -D "%%G" -1 -2 "C:\2Podcasts\Temp2\%%~nxG"
)
Move /Y C:\2Podcasts\Temp1\*.mp3 C:\2Podcasts\Backup2\

REM All original shortnamed files are in Backup2
REM All reduced shortnamed files are in Temp2

REM Ensure that all mp3's sound equally loud, files will remain in Temp2
"C:\Program Files\MyPrograms\mp3gain.exe" /r /d -4 /c /p C:\2Podcasts\Temp2\*.mp3

REM All reduced shortnamed files are still in Temp2

REM Move original files to Backup2 and the re-encoded files to LeveledFiles
Move /Y C:\2Podcasts\Temp2\*.mp3 C:\2Podcasts\LevelledFiles
Move /Y C:\2Podcasts\Temp2\*.* C:\2Podcasts\Backup2\

REM Turn the system to sleep
REM echo "Puting system to sleep"

REM pause
REM ping 127.0.0.1 -n 2 -w 1000 > nul
REM %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState
REM echo "Shutting system down"
REM shutdown.exe -s -f

=====END DOS Script voor Podcasts van Juice=====


=====Start of Copy ID3 tag script=====
REM I only needed this once to catch up with previously converted mp3's.
REM Copy the ID3 tag from the original files over to the re-encoded files that lost their ID3 tag.
REM Original files: "C:\2Podcasts\Backup2"
REM Re-encoded files: "C:\2Podcasts\LevelledFiles"

cd "C:\2Podcasts\Backup2"
FOR /R "C:\2Podcasts\LevelledFiles" %1 %%G IN (*.mp3) DO (
"C:\Program Files\MyPrograms\id3" -D "C:\2Podcasts\Backup2\%%~nxG" -1 -2 "C:\2Podcasts\LevelledFiles\%%~nxG"
)

=====End of copy ID3 Tag script=====

Zet scripting uit in AdobeReader


AdobeReader staat bij de meeste mensen standaard ingesteld. Dat betekend dat JavaScript aan staat. JavaScript voor het lezen van een PDF bestand? Dit is niet nodig én GEVAARLIJK. Een PDF bestand met JavaScript kan heel vervelende dingen doen en normaal gesproken heeft niemand JavaScript nodig in AdobeReader. Uitzetten dus. Hoe?

Ga naar Edit - Preferences, dan naar JavaScrip en zet het vinkje voor Enable Adobe JavaScript uit.

DropBox voor het delen van bestanden

Wij gebruiken op meerdere PC's het programma KeePass om onze wachtwoorden bij te houden. Vaak liepen de verschillende bestanden uit elkaar. Het helpt ook niet om het bestand centraal op de (locale) fileserver te hebben staan als je het nodig hebt terwijl je onderweg bent.

Nu gebruik ik DropBox. Het is gratis (tot 2 GB). Je laadt een klein programmatje dat een eigen folder aanmaakt die gesynchroniseerd wordt met een persoonlijke folder op het web. Door op meerdere PC's het programma naar dezelfde folder op het web te wijzen hebben alle PC's precies de zelfde bestanden. KeePass staat nu op alle PC's en haalt zijn bestand van de locale folder, die via DropBox verbonden is met het centrale web bestand. En wat als je nu eens geen internet hebt? Dan staan de laatste versies van de bestanden nog steeds op je eigen PC in de folder van DropBox.

Excel Macro's en Functies voor blokken met tekst

Ik werk vaak met diverse text of database bestanden waarbij de gegevens niet eenvoudig te splitsen zijn omdat er b.v. spaties voor en achter de gegevens staan of omdat de gebruikersnamen aan elkaar geplakt zijn waarbij ik alleen de hoofdletter van de voor en achternaam kan gebruiken om de namen weer uit elkaar te halen b.v. JanPeterBalkenende moet zijn Jan Peter Balkenende. Ook heb ik soms bestanden waar lege regels in zitten. Natuurlijk kan je, nadat je een extra kolom met oplopende nummers hebt toegevoegd om de oorspronkelijke volgorde terug te krijgen, het geheel sorteren en dan de lege rijen eruit halen, maar een macrotje doet dat wel zo snel. De meeste varianten pas ik regelmatig even aan aan de wens van dat moment, dus zijn deze maco's niet lang het zelfde bij mij. Om ze aan je eigen bibliotheek toe te voegen kun je op [Alt]+[F11] drukken om de VBA editor te openen.

Hier is een overzicht van de verschillende functies:














Sorry for the image of the table, adding a table in html caused some funny behaviour by blogger.


Here are some Macro's and functions which over time I found, modified or wrote my self to manipulate text blocks. Most of them are to split text strings e.g. to split a string on Caps turns JanPeterBalkenende in Jan Peter Balkenende. I often modify these functions as needed.

Again to add these, open your VBA editor by pressing [Alt]+[F11] and select [Alt]+[F8] to select the Macro's or use the "Function" button before the edit line and select "User Created" functions.

====Start of Macro Section======
Sub RemoveSpaces()
' Keyboard Shortcut: Ctrl+Shift+T
' Use Ctrl+Shift+T to Trim all SPACES in a selection, You must assign the Ctrl+Shit+WhateverLetter your self
' by using [Alt] + [F8] in Excel, select the macro and then press Options
For Each r In Selection
a = r.Address
r.Value = Evaluate("Trim(" & a & ")")
Next
End Sub
'=====
Sub DeleteBlankRows()
'Deletes the entire row within the selection if the ENTIRE row contains no data.
Dim i As Long
'We turn off calculation and screenupdating to speed up the macro.
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
'We work backwards because we are deleting rows.
For i = Selection.Rows.Count To 1 Step -1
If WorksheetFunction.CountA(Selection.Rows(i)) = 0 Then
Selection.Rows(i).EntireRow.Delete
End If
Next i
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub
'=====
Function CommaBeforeEveryCap(S As String) As String
'RobertVanDeMaan > Robert,Van,De,Maan
Dim X As Long
CommaBeforeEveryCap = S
For X = Len(CommaBeforeEveryCap) To 2 Step -1
If Mid(CommaBeforeEveryCap, X, 1) Like "[A-Z]" Then
CommaBeforeEveryCap = Left(CommaBeforeEveryCap, X - 1) & "," & Mid(CommaBeforeEveryCap, X)
End If
Next
End Function
'=====
Function SwapOnFirstCap(S As String) As String
'RobertVanDeMaan > VanDeMaan,Robert
Dim X As Long
SwapOnFirstCap = S
For X = 2 To Len(SwapOnFirstCap) Step 1
If Mid(SwapOnFirstCap, X, 1) Like "[A-Z]" Then
SwapOnFirstCap = Mid(SwapOnFirstCap, X) & "," & Left(SwapOnFirstCap, X - 1)
X = Len(SwapOnFirstCap)
End If
Next
End Function
'=====
Function CommaBeforeFirstNum(S As String) As String
'RobertVanDeMaan123 > RobertVanDeMaan,123
Dim X As Long
CommaBeforeFirstNum = S
For X = 2 To Len(CommaBeforeFirstNum) Step 1
If Mid(CommaBeforeFirstNum, X, 1) Like "[0-9]" Then
CommaBeforeFirstNum = Left(CommaBeforeFirstNum, X - 1) & "," & Mid(CommaBeforeFirstNum, X)
X = Len(CommaBeforeFirstNum)
End If
Next
End Function
'=====
Function CommaBeforeFirstCap(S As String) As String
'RobertVanDeMaan > Robert,VanDeMaan
Dim X As Long
CommaBeforeFirstCap = S
For X = 2 To Len(CommaBeforeFirstCap) Step 1
If Mid(CommaBeforeFirstCap, X, 1) Like "[A-Z]" Then
CommaBeforeFirstCap = Left(CommaBeforeFirstCap, X - 1) & "," & Mid(CommaBeforeFirstCap, X)
X = Len(CommaBeforeFirstCap)
End If
Next
End Function
'=====
Function RemoveBeforeLastDot(S As String) As String
'RobertVanDeMaan.com > com
Dim Y As Long
RemoveBeforeLastDot = S
For Y = Len(RemoveBeforeLastDot) To 1 Step -1
If Mid(RemoveBeforeLastDot, Y, 1) Like "." Then
RemoveBeforeLastDot = Mid(RemoveBeforeLastDot, Y + 1)
Y = 1
End If
Next
End Function
'=====
Function RemoveAfterLastDot(S As String) As String
'RobertVanDeMaan.com > RobertVanDeMaan
Dim Y As Long
RemoveAfterLastDot = S
For Y = Len(RemoveAfterLastDot) To 2 Step -1
If Mid(RemoveAfterLastDot, Y, 1) Like "." Then
RemoveAfterLastDot = Left(RemoveAfterLastDot, Y - 1)
Y = 1
End If
Next
End Function
'=====
Function CommaForLastSpace(S As String) As String
'Robert Van De Maan > Robert Van De, Maan
Dim Y As Long
CommaForLastSpace = S
For Y = Len(CommaForLastSpace) To 2 Step -1
If Mid(CommaForLastSpace, Y, 1) Like " " Then
CommaForLastSpace = Left(CommaForLastSpace, Y - 1) & "," & Mid(CommaForLastSpace, Y)
Y = 1
End If
Next
End Function
'=====
Function CommaForFirstSpace(S As String) As String
'Robert Van De Maan > Robert, Van De Maan
Dim X As Long
CommaForFirstSpace = S
For X = 2 To Len(CommaForFirstSpace) Step 1
If Mid(CommaForFirstSpace, X, 1) = " " Then
CommaForFirstSpace = Left(CommaForFirstSpace, X - 1) & "," & Mid(CommaForFirstSpace, X)
X = Len(CommaForFirstSpace)
End If
Next
End Function
'=====
Function CommaForSecondSpace(S As String) As String
'Robert Van De Maan > Robert Van, De Maan
Dim X As Long, MyCount As Long, Occurence As Long
CommaForSecondSpace = S
Occurence = 2
MyCount = 0
For X = 2 To Len(CommaForSecondSpace) Step 1
If Mid(CommaForSecondSpace, X, 1) = " " Then
MyCount = MyCount + 1
If MyCount = Occurence Then
CommaForSecondSpace = Left(CommaForSecondSpace, X - 1) & "," & Mid(CommaForSecondSpace, X)
X = Len(CommaForSecondSpace)
End If
End If
Next
End Function
'=====
Sub ClearTextToColumns()
'Once you used text to columns, Excel remembers this and performs this action on ANY text data that you paste into the spreadsheet.
'To stop this behaviour, you need to reset the text to columns settings.
On Error Resume Next
If IsEmpty(Range("A1")) Then Range("A1") = "XYZZY"
Range("A1").TextToColumns Destination:=Range("A1"), _
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, _
Tab:=False, _
Semicolon:=False, _
Comma:=False, _
Space:=False, _
Other:=False, _
OtherChar:=""
If Range("A1") = "XYZZY" Then Range("A1") = ""
If Err.Number <> 0 Then MsgBox Err.Description
End Sub

======End of Macro Section=====

Friday, May 14, 2010

Klassieke menu in Excel 2007

Nadat ik het Engelstalige klassieke Windows menu op Windows-7 had geïnstalleerd, zodat ik meer controle heb over de indeling en de meeste programma's met een of twee toetsaanslagen kan starten, zocht ik het klassieke menu voor Excel. Voor een deel zie ik het voordeel van de nieuwe menustructuur maar het kost mij veel meer tijd om de juiste tab te vinden en dan het juiste icoontje. Voor de meeste zaken gebruik ik de oude toetsenbord aanslagen. Door dit klassieke menu toe te voegen aan de nieuwe ribbon menu's heb ik beide tegelijkertijd.
Om dit aan Excel toe te voegen open je Excel. Daarna open je de VBA editor met behulp van [Alt] + [F11]. In je persoonlijke bestand (PERSONAL.XLSB) maak je onder Modules b.v. een nieuwe module "Menu" aan. Aan de rechterkant plaats je dan de VBA code van hieronder.


Ik heb deze code oorspronkelijk gevonden op deze site.

Na installatie ziet het er (Engelstalig) zo uit:

Sub MakeOldMenus()
Dim cb As CommandBar
Dim cbc As CommandBarControl
Dim OldMenu As CommandBar

' Delete it, if it exists
On Error Resume Next
Application.CommandBars("Old Menus").Delete
On Error GoTo 0

' Create an old-style toolbar
' Set the last argument to False for a more compact menu
Set OldMenu = Application.CommandBars.Add("Old Menus", , True)

' Copy the controls from Excel's "Built-in Menus" shortcut menu
With CommandBars("Built-in Menus")
.Controls("&File").Copy OldMenu
.Controls("&Edit").Copy OldMenu
.Controls("&View").Copy OldMenu
.Controls("&Insert").Copy OldMenu
.Controls("F&ormat").Copy OldMenu
.Controls("&Tools").Copy OldMenu
.Controls("&Data").Copy OldMenu
.Controls("&Window").Copy OldMenu
.Controls("&Help").Copy OldMenu
End With

' Make it visible. It appears in the Add-Ins tab
Application.CommandBars("Old Menus").Visible = True
End Sub

Sneller werken en sorteren met AutoHotKey


AutoHotKey is een programma dat eigenlijk op geen enkele PC zou mogen ontbreken. Dit omdat het zoveel zaken eenvoudiger en vooral sneller kan maken. Het nadeel van AutoHotKey is dat het vaak enige tijd kost om het script aan te passen aan je eigen behoeften.

Je kunt AutoHotKey heel goed gebruiken als je heel vaak een paar standaard antwoorden gebruikt. In dat geval kun je hele blokken tekst oproepen door het intypen van een codewoord (kijk maar bij ::mvg in het script) of door een tekstblok aan een toetscombinatie te koppelen (b.v. Ctrl Y).

Nadat je AutoHotKey ginstalleerd hebt zie je een letter H in een groen vlakje in de Taskbar. Door met je rechter muistoets op het icoontje te drukken kun je het standaard script bestand openen. Hieronder heb ik een bestandje dat ik zelf gebruik. Ik heb een paar zaken weggelaten of ingekort. Voor mij zijn de belangrijkste zaken die ik iedere dag gebruik de volgende:

De rechter [Alt] toets op mijn Dell Latitude E6500 is nu een extra [Del] toets geworden.
De rechter [Ctrl] toets is nu een extra [Insert] toest, voornamelijk voor FreeMind.
De [Windows] + [Spatie] combinatie start een nieuwe Google pagina.
De [Ctrl] + [Shift] + V plakt de informatie uit het klembord als tekst alleen, zonder formatering.
De [Ctrl] + [Shift] + $ om het Euro-teken (€) te krijgen.
En [Ctrl] + [Shift] + D om de huidige datum en tijd in documenten en bestandsnamen te plaatsen.

Daarnaast gebruik ik de vele afkortingen, waarvan ik er maar een paar in de lijst laat zien als voorbeeld.

Omdat ik ook veel met het sorteren van tabellen werk heb ik ook een paar scriptjes om b.v. Outlook adressen die door een ; gescheiden worden en waarvan de achternaam eerst staat met een comma en dan pas de voornaam, om te zetten naar de voornaam eerst en dan de achternaam in een tabel vorm.

Of om een kleine tabel op het klembord snel te sorteren en alle dubbele eruit te gooien.

Kijk maar of je er wat aan hebt.

P.s. Ik heb over tijd van zoveel verschillende plaatsen voorbeelden gebruikt dat ik het niet allemaal weet terug te vinden.

Hier is een voorbeeld van wat sommige toetscombinaties doen nadat je de bron hebt gekopieerd:

=============================================
Sorteer en verwijder dubbele gegevens (kopieëer de bron met [Ctrl]+c
Bron

adlg akrg'dig'dag d
adrjkyue;ihgnd f e'jgadrg e
adlg akrg'dig'dag d
eoittoeitjrdteie5toiiere4t e[ rie5t 9u5ty-]5y
adlg akrg'dig'dag d
54y45oyiy 45e5t4e5y wrept 5t veptvqetpjiw
adlg akrg'dig'dag d
ki8rin ubyuca v vm lqecqq/q
adlg akrg'dig'dag d
5 v4j5yj4o5iy6juoy 45y 45y 45p v45

[Ctrl]+[Shift]+U (dit wordt d.m.v. "plakken" geplaatst)
5 v4j5yj4o5iy6juoy 45y 45y 45p v45
54y45oyiy 45e5t4e5y wrept 5t veptvqetpjiw
adlg akrg'dig'dag d
adrjkyue;ihgnd f e'jgadrg e
eoittoeitjrdteie5toiiere4t e[ rie5t 9u5ty-]5y
ki8rin ubyuca v vm lqecqq/q

==============================================
Gegevens met spaties voor en achter de tekst opschonen
Bron

' adlg akrg'dig'dag d
adrjkyue;ihgnd f e'jgadrg e
' eoittoeitjrdteie5toiiere4t e[ rie5t 9u5ty-]5y
' 54y45oyiy 45e5t4e5y wrept 5t veptvqetpjiw
ki8rin ubyuca v vm lqecqq/q
' 5 v4j5yj4o5iy6juoy 45y 45y 45p v45

[Ctrl]+[Shift]+T
adlg akrg'dig'dag d
adrjkyue;ihgnd f e'jgadrg e
eoittoeitjrdteie5toiiere4t e[ rie5t 9u5ty-]5y
54y45oyiy 45e5t4e5y wrept 5t veptvqetpjiw
ki8rin ubyuca v vm lqecqq/q
5 v4j5yj4o5iy6juoy 45y 45y 45p v45

==============================================
Email gegevens in een lijst plaatsen
Bron

abc@xyz.com; def@xyz.com; ghi@xyz.com; jkl@xyz.com; mno@xyz.com; pqr@xyz.com

[Ctrl]+[Shift]+I
abc@xyz.com
def@xyz.com
ghi@xyz.com
jkl@xyz.com
mno@xyz.com
pqr@xyz.com

==============================================
Email adressen uit een lijst, d.m.v. ; aan elkaar rijgen.
Bron

abc@xyz.com
def@xyz.com
ghi@xyz.com
jkl@xyz.com
mno@xyz.com
pqr@xyz.com

[Ctrl]+[Shift]+I
abc@xyz.com; def@xyz.com; ghi@xyz.com; jkl@xyz.com; mno@xyz.com; pqr@xyz.com;

==============================================




=====AutoHotKey Script=====

;This is a block of often used abbreviations that I want to expand (in EVERY application)
;In case you temporarily don't want this, you can either suspend autohotkey or type the abbreviation
;with a space somewhere in the abbreviation, when you later remove the space, the abbreviation will not be expanded.
::adm::administration
::afd::afdelingen
::afh::afhankelijk van
::b v::bij voorbeeld
::bv::b.v.
::d m v::door middel van
::i p v::in plaats van
::i v m::in verband met
::incl::inclusief
::ipv::i.p.v.
::ivm::i.v.m.
::ism::in samenwerking met
::mgr::manager
::mgrs::managers
::mgt::management
::mw::medewerker
::mws::medewerkers

::=<::{ASC 8804} ; type equal and less than sign, didn't use <= as this can be used to create left arrow ::>=::{ASC 8805} ; type more than sign and the equal sign , didn't use => as this can be used to create right arrow
::+/-::{ASC 0177} ; type +/- sign
::=/-::{ASC 0177} ; type +/- sign ; to make it easier, not having to press the Shift key for the plus sign.

::mvg::Met vriendelijke groet,{Enter}{Enter}Robert Ilbrink{Enter}{Enter}http://nl.linkedin.com/in/robertpilbrink{Enter}

; [Windows Key] + [Space] = Open Google in new tab in your default browser
#space::Run www.google.com

;I use the RIGHT ALT key on my DELL Latitude E6500 as a delete key.
;Special line in case the Dutch/NL international Keyboard keyboard is selected in the language bar.
;i don't like it when the Delete key is located so far away to the right top part of the keyboard.
LControl & RAlt::Send {DEL}

;I use the RIGHT ALT key on my DELL Latitude E6500 as a delete key
;Now the Standard Line for the US Keyboard keyboard in the language bar.
RAlt::Send {DEL}

;Use the Right Control Button as my Insert button on my DELL Latitude E6500.
;I use the insert key a lot with e.g. FreeMind or Xmind, used to own MindManager in 1996...
RControl::Send {Insert}

;[Ctrl]+[Shift]+$ = € an alternative could have been ::$$::€ , You need two $$ to get one €...
LControl & $::Send €

;[Ctrl]+[Shift]+" = ", Since I often use the Dutch languagebar settings to quickly write characters like é and à, writing a single " requires you to type the " and a {Space} because the Dutch language setting will use the " in combination with a letter to turn it into a special character. Bij using a {Space} after the " it knows that only the " is required. Pressing [Ctrl] + [Shift] + " will give me a double quote without having to type an extra [Space]
LControl & "::Send, {SHIFTDOWN}'{SHIFTUP}{SPACE}

;[Ctrl]+[Shift]+D = Paste Date & Time
;In various documents and filenames I want to be able to quickly insert the current date and time. Does roughly the same as [Ctrl] + ; in Excel.
^+D::
FormatTime, CurrentDateTime,, yyyyMMdd-HHmm
SendInput %CurrentDateTime%
return

;[Ctrl]+[Shift]+V = Paste Text Only, remove all formatting before pasting text
;This is what it all started. In certain Office 2007 applications,
;I could no longer easily write simple VBA macro's to paste text values only. No it is one script with
;the same behaviour throughout ALL applications.....(except for Evernote as Evernote also uses this combination)
^+v::
bak = %clipboard%
clipboard = %bak%
Send ^v
return

;Sub-routine to strip funny characters, used in the sorting function
REMOVECHAR:
AutoTrim,Off
StringCaseSense,On
StringReplace,string,string,–,-,All ;emdash
StringReplace,string,string,´,',All
StringReplace,string,string,’,',All
StringReplace,string,string,©,(C),All
StringReplace,string,string,“,",All ;left quote
StringReplace,string,string,”,",All ;right quote
StringReplace,string,string,®,(R),All
StringReplace,string,string,¼,1/4,All
StringReplace,string,string,½,1/2,All
StringReplace,string,string,¾,3/4,All
StringReplace,string,string,™,TM,All
StringReplace,string,string,«,<<,All StringReplace,string,string,»,>>,All
StringReplace,string,string,„,",All
StringReplace,string,string,•,-,All ;bullet
StringReplace,string,string,…,...,All
Return

^+U:: ; [Ctrl]+[Shift]+U (Unsorted)
;Column Sorting & Unique Filter
;YOU must first place the unsorted list in the clipboard [Ctrl]+c.
;then move cursor to where you want to paste the sorted and Unique data and type [Ctril]+[Shift]+U.
string = %clipboard%
Gosub,REMOVECHAR ;remove if you don't want santized values
Sort,string,C U
clipboard := string
Send ^v
return

^+T:: ; CTRL-SHIFT+T (Trim)
;Trim whitespace at the START AND END of every line in a block of text
;First place the block of text in the clipboard [Ctrl]+c
;Move to where you want to paste the trimmed text and press [Ctrl]+[Shift]+T
;You have to loop through every line.
;The standard behaviour is to only remove the spaces in front of the first line and after the last line
;In excel, I use the age old CaseConvert macro from Chip Pearson to do this....
textblock = %clipboard% ; Copy clipboard to var. textblock
clipboard = ; clear clipboard
Loop, parse, textblock, `n, `r ; loop through text block
{
string = %A_LoopField% ; copy current line of text to var. string
string := RegExReplace( string, "(^\s+)|(\s+$)") ; remove pefix & suffix spaces
clipboard = %clipboard%%string%`r`n ; glue current line at the end of your clipboard
}
Send ^v
return

^+M:: ; CTRL-SHIFT+M (Mail)
; Mail...take every email address in a block of text and separate each line in the block with ;
; First YOU must place the block of text in the clipboard [Ctrl]+c
; Move to where you want to paste the adjusted text and press [Ctrl]+[Shift]+M
; The standard behaviour is to remove the first and last spaces in each line and to end each line with a ;
; If you have multiple addresses per line you have to replace the [Space] or other character with a ;
; Instead of many lines in the block, you will get one very long line with ; as separators.
textblock = %clipboard% ; Copy clipboard to var. textblock
clipboard = ; clear clipboard
Loop, parse, textblock, `n, `r ; loop through text block
{
string = %A_LoopField% ; copy current line of text to var. string
string := RegExReplace( string, "(^\s+)|(\s+$)") ; remove pefix & suffix spaces
clipboard = %clipboard% %string%; ; glue current line/string at the end of your clipboard
}
Send ^v
return

^+I:: ; CTRL-SHIFT+I (iMail)
; Mail...take every email address in a block of text and separate each address as a line
; First YOU must place the block of text in the clipboard [Ctrl]+c
; Move to where you want to paste the adjusted text and press [Ctrl]+[Shift]+M
textblock = %clipboard% ; Copy clipboard to var. textblock
clipboard = ; clear clipboard
Loop, parse, textblock, `n, `r ; loop through text block
{
string = %A_LoopField% ; copy current line of text to var. string
StringReplace,string,string,;,`r`n,All
clipboard = %clipboard% %string%`r`n ; glue current line at the end of your clipboard
}
textblock = %clipboard%
clipboard = ; clear clipboard
Loop, parse, textblock, `n, `r ; loop through text block
{
string = %A_LoopField% ; copy current line of text to var. string
string := RegExReplace( string, "(^\s+)|(\s+$)") ; remove pefix & suffix spaces
clipboard = %clipboard%%string%`r`n ; glue current line at the end of your clipboard
}
Send ^v
return

^+O:: ; [Ctrl]+[Shift]+O
;Swap list of strings around comma... Clinton, Bill becomes Bill Clinton
;YOU must first place the list in the clipboard [Ctrl]+c.
;then move cursor to where you want to paste the list and type [Ctril]+[Shift]+O.
Textblock = %clipboard%
clipboard = ; clear clipboard
Loop, parse, textblock, `n, `r ; loop through text block
{
CurrentString = %A_LoopField% ; copy current line of text to var. CurrentString
StringGetPos, pos, CurrentString,`,
if pos >= 0
{
length1 := pos
length2 := pos + 2
StringLen, length, CurrentString
StringMid, StringOnLeft, CurrentString, 1, %length1%
StringMid, StringOnRight, CurrentString, %length2%, %length%
StringOnRight := RegExReplace( StringOnRight, "(^\s+)|(\s+$)") ; remove pefix & suffix spaces
}
clipboard = %clipboard%%StringOnRight% %StringOnLeft%`r`n ; glue current line at the end of your clipboard
}
Send ^v
return


;======================================
;Commented out instructions that I don't use anymore
;
;LControl & !::Send Dit is een test met een{ENTER}nieuwe regel voor de volgende tekst{ENTER}en een derde regel.
;
; [Linker Control] + < = =< , srews up sizing of selected text in Word ;LControl & <::send {ASC 8804} ; [Linker Control] + > = => , srews up sizing of selected text in Word
;LControl & >::send {ASC 8805}

; [Linker Control] + + = +/- , screws up zooming with Ctrl +
;LControl & +::send {ASC 0177}

=====Einde AutoHotKey Script=====

MS Producer problemen met Internet Explorer


MS Producer, de gratis aanvulling op MS PowerPoint om video opnamen van presentaties te synchronyseren met de PowerPoint slides werkte niet meer op mijn nieuwe laptop. De browser bestanden van MS Producer (2007 Beta versie) lieten de IE 8 browser crashen. Na wat onderzoek bleek dat "Script debugging" aanstond. Door de twee instellingen om te zetten zodat Script Debugging nu uit stond, werkte alles weer. Toch vreemd dat een Microsoft applicatie web pagina's (en scripts) genereerd, die de eigen IE 8 laten crashen.

MS Producer, the free add-on to MS PowerPoint to combine video footage with the PowerPoint slides used during the presentation didn't work on my new laptop. The MS Producer browser files crashed my IE 8. After some research, I found that two IE settings to Disable Script Debugging were turned off (effectively turning Script Debugging ON). After changing these two settings, IE behaved as it should. It remains a strange thing that MS Producer creates files with scripts that let IE crash....