Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 12, 2012, 04:46 PM   #1
kdpyke
macrumors newbie
 
Join Date: Sep 2012
Applescript to Generate text based on day of the week and time.

Hi I think that what I need is pretty simple, but scripting it out may be very difficult. I'm pretty new to scripting in general, so I'm hoping someone can help me out.

I've been using automator to do some automatic video recording via QT. Getting the video to record is super easy, but handling the file afterward seems to be clunky and limited. Basically, I need a script that will generate a line of text to be used as a filename, contingent on what time and day of the week it currently is.

For example, if today is Friday between 6 and 7AM, I would like the result of the script to be "Waking up {day of week}, {current date} 6-7".

However if it is Tuesday between 1 and 2PM, I would like the result to be "Eating Lunch {day of week}, {current date} 1-2"

If I make a recording that is at an off time, where I haven't specified a time or event, I'd like the result to be "Unsorted video recording {day of week}, {current date}, {current hour:minute}".

Is this possible, and how difficult is it?
kdpyke is offline   0 Reply With Quote
Old Sep 14, 2012, 04:34 PM   #2
sero
macrumors member
 
Join Date: Aug 2008
It's not difficult. In bash check out date and conditionals (if,then,else).

Quote:
Originally Posted by kdpyke View Post
Hi I think that what I need is pretty simple, but scripting it out may be very difficult. I'm pretty new to scripting in general, so I'm hoping someone can help me out.

I've been using automator to do some automatic video recording via QT. Getting the video to record is super easy, but handling the file afterward seems to be clunky and limited. Basically, I need a script that will generate a line of text to be used as a filename, contingent on what time and day of the week it currently is.

For example, if today is Friday between 6 and 7AM, I would like the result of the script to be "Waking up {day of week}, {current date} 6-7".

However if it is Tuesday between 1 and 2PM, I would like the result to be "Eating Lunch {day of week}, {current date} 1-2"

If I make a recording that is at an off time, where I haven't specified a time or event, I'd like the result to be "Unsorted video recording {day of week}, {current date}, {current hour:minute}".

Is this possible, and how difficult is it?
sero is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iMessage/text day/time calendar link? Chabba iOS 7 2 Mar 16, 2014 02:47 AM
Document Maker- Create, Edit Rich Text & Generate PDF Documents DanneSAndin iPad Apps 1 Feb 26, 2014 04:49 AM
Document Maker- Create, Edit Rich Text & Generate PDF Documents DanneSAndin iPad Apps 0 Jan 7, 2014 06:34 AM
Document Maker - Create & Edit Rich Text Docs and Generate PDF Anas123 iPhone and iPod touch Apps 0 Oct 12, 2013 05:03 AM
Applescript Is there a way to search for a time or date withi text wild4life2013 Mac Programming 5 Sep 20, 2013 12:35 PM

Forum Jump

All times are GMT -5. The time now is 03:49 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC