Editing in a different app

While trying some more advanced Keyboard Maestrofu I stumbled about the Tips and Tricks of  Flip Martin

The remote editing part was looking interesting so I implemented it, just to get another idea a day later:
Why not use this as a general way to allow remote editing?
The only changes it really takes is saving the application which is being used in a token and than when we save from Sublime Text to bring the window of the application back to the front.
Here are the changed scripts (I marked the changes in red) :
Edit in Sublime Text
End Remote Editing

Blogging, Zapier and Evernote

Well, I like the general Idea to blog via Evernote.

If it wouldn’t be so cumbersome.
Just found out today that Zapier does exactly what it says, If there is a NEW note in Evernote, publish it on WordPress.
The problem arises if you start creating a note, and later add the tag published to it (which will than get this note around the filter) to send it to WordPress.
It doesn’t work, because this isn’t a new Note.
What works is that if you create a note in a different Notebook and than move the note over into the Notebook which is hooked up to Zapier it will be than processed.
We will see

Get-ChildItem -Recursive with a limit

Today I had the need to use Get-ChildItem in recursive mode, but I also needed to be able to stop the recursion at a specific level.
Unfortunately the Get-ChildItem doesn’t have the capability to do this.
Luckily there are others around which had the same problem already and found a solution:
function Get-ChildItemToDepth {
    [String]$Path = $PWD,
    [String]$Filter = "*",
    [Byte]$ToDepth = 255,
    [Byte]$CurrentDepth = 0,
  if ($DebugMode) { $DebugPreference = "Continue" }
  Get-ChildItem $Path | ForEach-Object {
    $_ | Where-Object { $_.Name -like $Filter }
    if ($_.PsIsContainer) {
      if ($CurrentDepth -le $ToDepth) {
        # Callback to this function
        Get-ChildItemToDepth -Path $_.FullName -Filter $Filter -ToDepth $ToDepth -CurrentDepth $CurrentDepth
      } else {
        Write-Debug $("Skipping GCI for Folder: $($_.FullName) " +
          "(Why: Current depth $CurrentDepth vs limit depth $ToDepth)")

Activate / De-activate VPN per AppleScript

Just got a good Deal for a VPN Provider to different countries to secure Wireless Connections via VPN Unlimited.

Link to deal https://deals.cultofmac.com/?rid=199289 , offers  expires 2014/08/22

I don’t want to keep it running by default so I created a short script to activate / de-activate the VPN via Keyboard Maestro.

Keyboard Maestro Editor VPN Switch

and here the script:

tell application "System Events"
    tell current location of network preferences
        set VPNservice to service "VPN Unlimited (Germany)"
        set isConnected to connected of current configuration of VPNservice
        if isConnected then
            disconnect VPNservice
            set onOff to "off"
            connect VPNservice
            set onOff to "on"
        end if
    end tell
end tell
return onOff

I now just need to figure out how to use more than one profile (the profile is auto configured via an app).

Still if this VPN Provider works to my satisfaction I guess I will subscribe longer after the first 3 years.