Software development, photography, jokes, ....

Sites by me

 
tas-logoTransportation Administration System
snoezelkussen-logo-kleinstSnoezelkussens voor verstandelijk gehandicapten
ikzoekeenbegeleider-logoBegeleiders voor gehandicapten
Laat uw hond het jaarlijkse vuurwerk overwinnen
Betuweroute en Kunst
logo 50x50Hey Vos! Je eigen naam@vos.net emailadres?
Kunst in huis? Nicole Karrèr maakt echt bijzonder mooie dingen
nettylogo2Kunst in huis? Netty Franssen maakt ook bijzonder mooie dingen
Professionele opvang bij Gastouderbureau
Kind-Zijn
Salarisadministratie en belastingadvies bij
De Zaak Loont
Zutphense Bomenstichting

Hosting Favorites

 
ANU Internet Services
XelMedia .internet Services
register.com

Blogroll

 
Bomenstichting
LassoSoft
MacFreak
Quality that computes
The Economy of Motion
Wheel 2.0
IntrAktv



Website Hosting bij Xel Media

Marc's Place


 

 Scripts for Applescript, ASP, JS, a.o.

Send E-Mail to Evernote AppleScripts

 Pasted Graphic
A while ago i was looking for a way to shrink my list of mailboxes and the 1000s of mails therein. I have used MailSteward Pro to backup my emails to a remote MySQL server for a long time, in case everything gets lost at Apple's iCloud. Which isn't very likely, so I started looking for another way to archive old emails and still have the same easy access with all search capabilities. This where Evernote comes in! With Evernote I can search on anything, even text in PDFs and images.

Googling a bit I found this AppleScript: Apple Mail to Evernote. The script works nearly perfect and I added and changed some code to get the date/time in the title of the note and some other things.
A screenshot of how an email in Evernote looks when my modified version of the script has done its job:

Screen Shot 2014-05-15 at 10.49.19

In May 2016 I duplicated the script and made one for Microsoft Outlook, which is currently my favorite e-mail client.
Follow my blog-posts for any updates on these scripts.

Note : for some obscure reason I have not found yet, the compiled scripts sometimes do not extract the message(s). In that case, use the uncompiled scripts.

Download zip

To install the scripts, open the User Scripts Folder ~/Library/Scripts/ or use the AppleScript menu to open the User Scripts folder:

Screen Shot 2016-05-31 at 19.08.03
and simply move the app-versions into this folder and you will see both the scripts listed under the AppleScript Menu.
Next, go into Apple Mail or Microsoft Outlook, select one or more emails and choose the matching script from the AppleScript menu. Check the chosen Evernote notebook if your selected emails are in there, and if so, you can delete the original messages.

If you do not see the AppleScript Menu icon in your menu bar, you can enable it in Script Editor’s General preferences:

Screen Shot 2016-05-31 at 19.12.54

Note : Some encoded message-content seems impossible to convert, and the script would crash. What I did is that the note in Evernote is created, with the nice header and all attachments, but with the encoded message text.
What you then have to do is to go into Apple Mail or Microsoft Outlook and copy the email text, go back to Evernote and delete the encoded text and then paste the message text into the note.

Thanks to Veritrope for the basis of this very useful script!


Download zip

Save and Restore Apple Finder Windows scripts

 finder
Since Apple released Mavericks (10.9), the Finder doesn't save and restore its open windows, and the tabs inside these windows. I find this a real nuisance and it wonders me why Apple haven't been able to fix this. I tried writing 'defaults' settings, with no effect.

Anyway, then I decided to write my own solution, in AppleScript. After googling a few hours on how to do things in AppleScript, I came up with two scripts:

The 'Save Finder Windows'-script


This script saves the current open windows, their positions and sizes, including the tabs inside these windows ... into a text file! This text file can be edited and modified in Sublime or TextWrangler. You can also sync it to another Mac!

The text file is stored in your Preferences folder :

/Users/yourname/Library/Preferences/windowtabs.txt

Its contents look like this:

$0$23$1279$1440
Macintosh HD:Users:yourname:Dropbox:Projects:
Macintosh HD:Users:yourname:OneDrive - SDS82:Projecten:
Macintosh HD:Users:yourname:Downloads:
Macintosh HD:Users:yourname:Sites:begeleider:
Macintosh HD:Users:yourname:Sites:marc.vos:
$1281$23$2560$1440
Data HD:_Foto (nog doen):Scansessie dia's van onszelf:Megabox:02:
Macintosh HD:Users:yourname:Pictures:~ Foto archief:


Lines that start with a $-sign are Finder Windows coordinates, separated by $-signs.
Lines that follow a Finder Window definition, are paths that are made into tabs inside that Finder Window.

You see that you can modify this TXT-file yourself and add or remove windows and paths (tabs).

The 'Restore Finder Windows'-script


This script reads the text file, creates the windows at their saved positions with their saved sizes and reopens, inside these windows, the saved paths as tabs.

How to execute the scripts


Of course you can execute scripts at any moment you like. The text file will be overwritten, with each execution of the 'Save Finder Windows'-script.
I added both these scripts to the Scripting Menu. But you can also add them to the Finder's toolbar or just place them on the desktop or ... or ...

20160608.Save and Restore Finder Windows

Download


The ZIP contains the editable scripts and the compiled versions.

Download zip
 

AppleScript to create a new folder inside current or selected folder

 finder
Here's an AppleScript with which one can create a new folder inside a current or selected folder, or inside a current window or inside a folder containing a selected item.

Code

tell application "Finder"
set theList to selection
if theList is {} then
-- Nothing selected
set x to (folder of the front window)
else
-- Only the first item is significant
set x to item 1 of theList
end if

-- Check for file selection
set theClass to class of x
if theClass is not folder then
set x to (container of x)
set theClass to class of x
end if

-- Create new folder inside selected folder
if theClass is folder then
set theFolder to x as string
--display dialog theFolder
try
set theName to text returned of (display dialog ¬
"Create folder named:" default answer "Untitled")
set y to make new folder at theFolder with properties {name:theName}
on error
-- display dialog "Nothing happened"
end try
end if
end tell

Implementation


Compile and export it as an application, then drag it onto a Finder-window's toolbar:

Screen Shot 2016-07-01 at 11.34.22

Then, wherever you need a new folder, simply select something in the finder and click on New Folder:

Screen Shot 2016-07-01 at 11.40.14
 

JavaScripts


In this download, you will find three conversion scripts:
  • Celsius to/from Fahrenheit
  • The leapyear test
  • Conversion between number systems (dec to bin/hex/oct/surprise)
and set, consisting of a login script and a user-maintenance script, which uses a generated hash table to check against entered username/password, on the client's computer - no check on a server involved.


Download

Subversion start-up script


The download contains a Subversion StartupItem for OS X that will start svnserve with option -d so it runs as a standalone deamon. Just unzip and double-click the package file.


Download    

TN5250j Startup script


Here's an AppleScript to start the TN5250j Terminal Emulator with multiple sessions in one window. You can add this icon to the dock between your other applications.


Download    

AppleScripts for Tex-Edit Plus


Here you can download some handy AppleScripts for Trans-Tex' Tex Edit Plus.
  • Mac -> PreHTML : Inserts the page structure and surrunds the original content with <pre></pre>.
  • Mac -> ISO-set : Translates some special characters to HTML entities.
  • Make <SELECT> pop-up menu : creates a pop-menu wth an onChange event from the original content.



Download      

Keep track of your kilometerage

My learning project for Active Server Pages : a webpage to register the kilometers you drive for private or business use and the costs for your car(s). You can register an unlimited number of cars. An empty Access-database is included.


Download    
© 1997- Marc Vos (and others) Contact Me