Sending variable data from OSX to Windows

End user supplied how to documents and discussion.

Sending variable data from OSX to Windows

Postby patience1312 » Mon Jul 06, 2015 12:05 am


I created a way to share variable data between a OSX and WIN machine with 3 scripts. Before I did some research but couldn't find a solution, that's why I like to share it with you :wink: The setup is as follows:

Create a UTF-8 txt file on a shared folder on the windows machine which you will later access via smb.
Make a QuicKey Shortcut on the mac to test the smb-connection, first ping (if the Win-machine is running), then try to connect. If the first trial did not work I automatically start the Win-machine with "Wake me" for OSX :D.

When the OSX is connected to the smb-folder I open the connection with vi in an osx-terminal. The vi-terminal window stays open whatever process I am running on my OSX.
The win machine has to have also a QuicKeys software running. I basically checks every 2 seconds if the txt-file is bigger than 3kb. If yes, it opens the txt file, checks the first character which is a number that can be compared for a specific command. This means I copy the number (first character in the txt) into the clipboard and compare it (1 is action 1, 2 is action 2) and then read in the variable (delete the highlighted action number and select all) and assign it to var1.

I created a shortcut which can be put into any other shortcut to send whatever information I like to the Win-machine. It basically switches to OSX terminal and first reset the file (:%d) then write any letter to enter writing/editing mode (which is a "a"-keystroke for me) and then enter the action number and then the variable into the vi. next save the vi-file. After some seconds the windows machine recognizes the changed filesize and reads in the variables in the txt-file.

What can it be used for?
When I display client information on my OSX I can automatically display the clients website on my WIN-machine. Nice, isn't it?

Posts: 1
Joined: Tue Dec 30, 2014 5:17 pm

Return to QKM How Tos

Who is online

Users browsing this forum: No registered users and 8 guests