1+ # Script Name : of_review
2+ # Author : Craig Richards
3+ # Created : 9th December 2012
4+ # Last Modified : 11th December 2012
5+ # Version : 1.1
6+
7+ # Modifications : 1.1 - CR - Added a feature to get the current user, and also create the folder in the dropbox folder to store the photos for the blog post
8+
9+ # Description : This will create a new project titled with the name of the product review so I have all of the actions I need to do
10+
11+ -- Display a prompt to get the script title, this will also be the project name
12+
13+ display dialog " Name of the product I am reviewing" default answer ""
14+ set postName to (text returned of result )
15+
16+ tell application " System Events"
17+ set currentUser to (name of current user)
18+ end tell
19+
20+ -- Load OmniFocus and create the project
21+
22+ tell application " OmniFocus"
23+ tell default document
24+ -- Set the primary context for the project
25+
26+ set pContext to first flattened context where its name = " Product Review"
27+
28+ -- Set the individual task context
29+
30+ set tContext to first flattened context where its name = " Computer"
31+
32+ -- Set the folder to store the project
33+
34+ set myFolder to first flattened folder where its name = " Reviews"
35+
36+ -- Set the date to start the project to today's date
37+
38+ set dateToday to (current date )
39+
40+ -- Create the project in the given folder
41+
42+ set MyProject1 to make new project with properties {name :postName, context :pContext} at end of project of myFolder
43+ tell MyProject1
44+
45+ -- Create the tasks
46+
47+ set MyAction to make new task with properties {name :" Kit added into Bento" , context :tContext, start date :dateToday}
48+ set MyAction to make new task with properties {name :" Folder created in dropbox" , context :tContext, start date :dateToday}
49+ set MyAction to make new task with properties {name :" Pictures downloaded and stored in folder" , context :tContext, start date :dateToday}
50+ set MyAction to make new task with properties {name :" Test the product" , context :tContext, start date :dateToday}
51+ set MyAction to make new task with properties {name :" Draft Started" , context :tContext, start date :dateToday}
52+ set MyAction to make new task with properties {name :" Post Finished" , context :tContext, start date :dateToday}
53+ set MyAction to make new task with properties {name :" Review and spell check" , context :tContext, start date :dateToday}
54+ set MyAction to make new task with properties {name :" Final Read through" , context :tContext, start date :dateToday}
55+ set MyAction to make new task with properties {name :" usual final paragraph added" , context :tContext, start date :dateToday}
56+ set MyAction to make new task with properties {name :" Also like blog code" , context :tContext, start date :dateToday}
57+ set MyAction to make new task with properties {name :" tags assigned" , context :tContext, start date :dateToday}
58+ set MyAction to make new task with properties {name :" post scheduled" , context :tContext, start date :dateToday}
59+ set MyAction to make new task with properties {name :" Tinyurl created" , context :tContext, start date :dateToday}
60+ set MyAction to make new task with properties {name :" Bento Updated" , context :tContext, start date :dateToday}
61+ set MyAction to make new task with properties {name :" Tweets about post" , context :tContext, start date :dateToday}
62+ set MyAction to make new task with properties {name :" G+ about post" , context :tContext, start date :dateToday}
63+ set MyAction to make new task with properties {name :" Clean Up dropbox folder" , context :tContext, start date :dateToday}
64+ set MyAction to make new task with properties {name :" Update bento with product details go back" , context :tContext, start date :dateToday}
65+ set MyAction to make new task with properties {name :" Send item back" , context :tContext, start date :dateToday}
66+ end tell
67+ end tell
68+ end tell
69+
70+ tell application " Finder"
71+ set mainFolder to " Macintosh HD:Users:craigdba:Dropbox:Geek Computers:Posts:reviews" as alias
72+ make new folder at folder mainFolder with properties {name :postName, location :mainFolder}
73+ end tell
0 commit comments