What to do if you wan’t to use a version control and deliver to co-workers always a up to date version of your scripts?
I found a solution. Git. See the webpage git-scm.com. But how to deliver the controlled scripts? On Windows you can use the msysgit and tortoisegit. After you have once downloaded the git on the machine evrybody will be able to make a right mouse click and say “sync/pull”. But what to do on a mac?
Well – I wrote something.
U can use AppleScript with the terminal.
Download and install Git on the Mac. And then use these two AppleScripts.
They work best if you close the Terminal.app before launching. Download them here
--First script "cloneGit_at_appLocation.app" start:
-- Get the path of the script
set StoredPath to (path to me) as string
-- get the parent folder of the script
tell application "Finder"
set theFolder to (container of item StoredPath) as text
end tell
-- get the ":" from the path and replace them with "/" so terminal will understand
set EditedPath to quoted form of POSIX path of theFolder
-- open terminal
tell application "Terminal"
activate
--wait a moment
delay 3
-- change to the folder where the script is
-- if you run this from the Skripteditor it will use the path of the editor
-- save the script as .app then it will use the apps path
do script "cd " & EditedPath in front window
-- now clone the git hello-world
do script "git clone git://github.com/git/hello-world.git" in front window
end tell
-- you are done
--First script "cloneGit_at_appLocation.app" end.
*****
The second script has to be inside the new folder the first script created
*****
--second script "pullGit_at_appLocation.app" start:
-- this is mostly the same as the "cloneGit_at_appLocation.app" script
-- get the path
set StoredPath to (path to me) as string
--get parent
tell application "Finder"
set theFolder to (container of item StoredPath) as text
end tell
-- replace ":" with "/"
set EditedPath to quoted form of POSIX path of theFolder
-- open terminal
tell application "Terminal"
activate
-- wait
delay 3
-- go to folder
do script "cd " & EditedPath in front window
-- update the git in this folder
do script "git pull origin master" in front window
end tell
--second script "pullGit_at_appLocation.app" end.
How to get RSS-Feeds out of Mail.app into NetNewsWire.app
Do you read RSS Feeds? I do. But reading lots of feeds in Apples Mail makes it slow. So how to move them to a external feedreader like NetNewsWire?
Use this shell script to export your data into a textfile on your desktop.
( make a new textfile copy paste the code. Save it. giv it a .sh insted of the .txt run it from… Textmate? Terminal? )
IFS=$'\n';for i in $(find ~/Library/Mail/RSS/ -name "Info.plist");do grep "http://" $i | sed "s/.*\(http[^<]*\).*/\1/" >> ~/Desktop/Mail\ Feeds.txt;done
Then go to NetNewsWire and export the basic feeds that are in there. It makes a .opml file. This is just an xml. Change your textfile to the structure of the .opml file.
< ?xml version="1.0" encoding="UTF-8"? >
< !-- OPML generated by TMN Manually -- >
< opml version="1.1" >
< head >
< title>Mail Feeds< /title>
< /head>
< body>
< outline text="The-moron.net" description="This is the Blog of the-moron.net" title="3xW.T-M.N" type="rss" version="RSS" htmlUrl="http://www.the-moron.net/" xmlUrl="http://www.the-moron.net/blog/?feed=rss2"/>
< /body>
< /opml>
and than change the .txt to .opml
After that import the .opml file.
Done!