/
document.wflow
179 lines (169 loc) · 5.22 KB
/
document.wflow
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AMApplicationBuild</key>
<string>428</string>
<key>AMApplicationVersion</key>
<string>2.7</string>
<key>AMDocumentVersion</key>
<string>2</string>
<key>actions</key>
<array>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>1.0.2</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>source</key>
<dict/>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Run AppleScript.action</string>
<key>ActionName</key>
<string>Run AppleScript</string>
<key>ActionParameters</key>
<dict>
<key>source</key>
<string>(*add - new item alertThis Folder Action handler is triggered whenever items are added to the attached folder.The script will display an alert containing the number of items added and offering the userthe option to reveal the added items in Finder.Copyright © 2002–2007 Apple Inc.You may incorporate this Apple sample code into your program(s) withoutrestriction. This Apple sample code has been provided "AS IS" and theresponsibility for its operation is yours. You are not permitted toredistribute this Apple sample code as "Apple sample code" after havingmade changes. If you're going to redistribute the code, we requirethat you make it clear that the code was descended from Apple samplecode, but that you've made changes.*)property dialog_timeout : 30 -- set the amount of time before dialogs auto-answer.on adding folder items to this_folder after receiving added_items try tell application "Finder" --get the name of the folder set the folder_name to the name of this_folder end tell -- find out how many new items have been placed in the folder set the item_count to the number of items in the added_items --create the alert string set alert_message to ("Folder Actions Alert:" & return & return) as Unicode text if the item_count is greater than 1 then set alert_message to alert_message & (the item_count as text) & " new items have " else set alert_message to alert_message & "One new item has " end if set alert_message to alert_message & "been placed in folder " & «data utxt201C» & the folder_name & «data utxt201D» & "." set the alert_message to (the alert_message & return & return & "Would you like to view the added items?") display dialog the alert_message buttons {"Yes", "No"} default button 2 with icon 1 giving up after dialog_timeout set the user_choice to the button returned of the result if user_choice is "Yes" then tell application "Finder" --go to the desktop activate --open the folder open this_folder --select the items reveal the added_items end tell end if end tryend adding folder items to</string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.Automator.RunScript</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>RunScriptAction</string>
<key>InputUUID</key>
<string>72338058-E4D9-45E7-AB6A-2230DACB48E9</string>
<key>Keywords</key>
<array>
<string>Run</string>
</array>
<key>OutputUUID</key>
<string>C0695FFA-A334-468A-A916-C97EE5F233F7</string>
<key>UUID</key>
<string>34F2EEA5-E8B0-44A2-9A6E-4130DF40F82D</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<string>on run {input, parameters}
(* Your script goes here *)
return input
end run</string>
<key>name</key>
<string>source</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
</dict>
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>309.000000:316.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run AppleScript.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<true/>
</dict>
</array>
<key>connectors</key>
<dict/>
<key>workflowMetaData</key>
<dict>
<key>folderActionFolderPath</key>
<string>~/Library/LaunchAgents</string>
<key>workflowTypeIdentifier</key>
<string>com.apple.Automator.folderAction</string>
</dict>
</dict>
</plist>