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