Random mail...

Sometimes a wifi service wants your mail to register on their service. Sometimes it's to grant you full access, sometimes it is just to give you a few minutes so that you get their confirmation mail and register.

In any case, you generally don't want to give your email to just about anybody. I was thinking of creating a random mail generator that creates  valid "enough" mails that they pass muster when you paste them in a mail field. Because sometimes, the few minutes you are granted to confirm that email are enough to just check your own mail and be done with the wifi access.

So, here it is.


use scripting additions

global mailCharacters
set mailCharacters to ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]

set myName to myRandomString(10)
set myDomain to myRandomString(10)
set myExtension to myRandomString(3)

set myNewMail to myName & "@" & myDomain & "." & myExtension
set the clipboard to myNewMail

on myRandomString(n)
set myString to ""
set myLength to random number from 2 to n
repeat with i from 1 to myLength
set myString to myString & item (random number from 1 to length of mailCharacters) of mailCharacters
end repeat
end myRandomString


The script creates something like:

[between 1 and 10 characters]@[between 1 and 10 characters].[between 1 and 3 characters]

and puts it into the clipboard so that you just have to run the script, and paste in the field where you need to put a mail.

It's pretty trivial, but it is just what I need.

Also, if you're a tad conscious about security, you should use a VPN over a free wifi, but that's another story.

OmegaT launcher in applescript

As a follow-up to a discussion on the OmegaT list*, I put my OmegaT launcher applescript on github:


I'll write a more detailed post about that one later.

It should be useable as is.

To test it, open it with Script Editor and click on Run (▶︎) or hit Cmd+R. You should see a dialog with 3 buttons and "Create Project" is selected (this function does not work).

Now, if you select a project in Finder and you run the script, you should see the same dialog but with "Open Project" as the selected button. Clicking on it should launch Terminal and from there OmegaT with a default command that looks like this by default:

java -Xdock:name=OmegaT -jar '/path/to/OmegaT.jar' '/path/to/project/' --no-team

Once you're satisfied with the script, use File > Export and select "Application" as the file format. Then you can use it as a normal application, etc.

There are plenty of TODOs in the file. I'm planning to slowly fill them with working code. If you have ideas, don't hesitate to make suggestions.

* After Didier Briel left the OmegaT project a few days ago, he asked me to take the role of "twitter community manager", and so I'm back into the OmegaT Project, after an 18 months lapse. Aaron Madlon-Kay is the new project manager. Don't hesitate to follow @OmegaTOfficial on Twitter if you don't already.

Popular posts (last 30 days):