Showing posts with label Applescript. Show all posts
Showing posts with label Applescript. Show all posts

Wednesday, April 3, 2013

AutoShot: Automatic Screenshot Taker

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
AutoShot. I couldn't resist naming an elementary AppleScript script. It was too good a name to pass up.

Autoshot automatically takes screenshots of your Mac while you play your game, or work on your project, so you can document your work or play, without having to press the combination of keys to take a screenshot. There are full fledged apps out there that might do this, but this is a simple script that can do the same. You can decide the delay between each screenshot, and for how long should the script take the screenshots.

Here is the code incase you want to edit it anyway. I took bits of code from places, as I'm slightly rusty at this. To change the format of the image, simply edit the ".png" bit.

display dialog "AutoShot: Automatic Screen Capture Script 
Gap between each shot(in seconds)" default answer "" buttons {"OK", "Cancel"} default button 1 --Q&A for user, to determine factors of taking screenshots
set beta to text returned of result
display dialog "Period of time for the screenshots to be taken(in minutes)" default answer "" buttons {"OK"} default button 1
set zeta to text returned of result --period of time for shots to be taken
display dialog "Screenshots will be saved on folder named 'AutoShot' on Desktop" buttons {"OK"} default button 1

set dFolder to "~/Desktop/AutoShot/"

do shell script ("mkdir -p " & dFolder)

set zeta1 to zeta * 60 --converting input to seconds
set alpha to (zeta1 / beta) --calculating no. of times the screenshot code has to be repeated


repeat alpha times --Repeat Code
set tTime to do shell script "date +%H%M%S"
do shell script ("screencapture " & dFolder & tTime & ".png")
delay beta --Gap between each shot
end repeat

The download link for the app that doesn't need AppleScript editor. Its a standalone app, so it'll run the script on simply running the app.

Saturday, August 25, 2012

Terminal Mischief ;)

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
The Macintosh operating system is often thought to be extremely serious and po-faced, only dedicated to serving corporates and artists alike. But there is a fun, childish side to the Macintosh OS not many people know about, and even fewer know how to access it. Here's a guide to access those awesome features.

First open Terminal
[Applications>Utilities>Terminal] or use Spotlight





Now make your Mac speak anything out loud. Anything you want.
Simply type,
say [type text you want to hear your Mac speak aloud]

Unleash your Mac's artistic talents by producing ASCII art with a few keystrokes.
Type,
banner [text to be converted into ASCII art]


To save the ASCII art to a text file,

Navigate to Desktop.
cd Desktop
 Now type in the command,
banner [text] > [filename].txt 

Now open the file from Desktop.


To show it more clearly here, I converted the txt file to a pdf.



Awesome stuff isn't it? There are many more Terminal tricks. You can even access retro games  such as Pong, Tetris, and others using eMacs.

Thursday, April 5, 2012

Mac Virus

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
Ok, this isn’t exactly a real Mac virus. But it’s a good way too prank your friends(or foes!). With the help of AppleScript you can instruct the Mac to perform several tasks. Although Applescript is generally used for boring stuff like sending bulk mails or doing something productive, it can also be extremely fun if you have a devious plan in mind!

Open AppleScript Editor.


Open AppleScript Editor


This is where you write the code.

 
AppleScript Editor


Type in,


say “Warning! Virus Alert!” using “Vicki”




Voice command



Mac will now issue a ‘warning’ and say whatever you type in using the voice Vicki, who is [I think!] spanish. Hmm....


Now,

display dialog “Virus Alert! Mac has detected a virus.” buttons {“OK”} default button 1




Dialog Command

Mac will now display a dialog with the warning.


Prompt


now type,

tell application "Finder"
shut down
end tell

Shut Down command


Mac will now shutdown!

Click Compile, and then save it as an Application.
Don’t click Run! Or your Mac will shut down!


Save
Save as Application


Now change the logo of the application, or do whatever but get your nemesis to open the application and face your wrath!

 
//PART 2