Hi Everyone, I hope you can help me out and I hope this is the right place to ask.
We have a script that an employee wrote a few years ago and he no longer works here, nobody here knows enough about this to fix it but we send files out to users in a zip with the script and when you run the script it’s supposed to move the files from the zip to the IBM Notes Data install location (our company uses Notes for everything). This script stopped working in Sierra and only creates the folder and doesn’t move the files. I hope somebody can take a look at it and tell me why it no longer works in Sierra and perhaps a fix for it as there doesn’t really appear to be any kind of self-extracting solution for Mac that works for us.
If this isn’t even applescript, I am sorry and maybe someone can point me to somewhere where I can get help and I hope I’m posting in here correctly. I am not a native mac user.
<?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>381</string>
<key>AMApplicationVersion</key>
<string>2.4</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>-- Version 1.2 Click Me Script
-- Updated Nov. 20, 2013
-- Added Notes 9 folder support
tell application "System Events"
set userName to name of current user
end tell
tell application "Finder"
set folderName to "folder name here" as text
set successFlag to 0
--set thisFolder to (target of front Finder window) as alias
--set thisFolder to POSIX path of ((container of (path to me)) as text)
set thisFolder to ((container of (path to me)) as alias)
set theTargetFolder to ("Macintosh HD:Users:" & userName & ":Library:Application Support:Lotus Notes Data:")
set theCourseFolder to ("Macintosh HD:Users:" & userName & ":Library:Application Support:Lotus Notes Data:" & folderName)
if (exists folder theTargetFolder) is false then
set theTargetFolder to ("Macintosh HD:Users:" & userName & ":Library:Application Support:IBM Notes Data:")
set theCourseFolder to ("Macintosh HD:Users:" & userName & ":Library:Application Support:IBM Notes Data:" & folderName)
end if
set filesToMove to (every file of thisFolder whose name extension is "nsf")
if (exists folder theCourseFolder) is false then
make new folder at theTargetFolder with properties {name:folderName}
end if
try
move filesToMove to theCourseFolder
on error
display dialog "File(s) already exist. Do you wish to overwrite?" buttons {"Yes", "No"}
if the button returned of the result is "Yes" then
move filesToMove to theCourseFolder with replacing
else
set successFlag to 1
end if
end try
if successFlag = 0 then
display dialog "File(s) moved successfully." buttons {"OK"}
else
display dialog "File(s) not moved." buttons {"OK"}
end if
end tell</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>0F225918-9142-442F-92A9-B9032A232B6F</string>
<key>Keywords</key>
<array>
<string>Run</string>
</array>
<key>OutputUUID</key>
<string>F8B2933E-DE4D-4D38-88BB-49C5F86E6A27</string>
<key>UUID</key>
<string>6C8E865E-235B-44E0-BA48-CE29DBD45F57</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>conversionLabel</key>
<integer>0</integer>
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>309.500000:498.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run AppleScript.action/Contents/Resources/English.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<true/>
</dict>
</array>
<key>connectors</key>
<dict/>
<key>workflowMetaData</key>
<dict>
<key>workflowTypeIdentifier</key>
<string>com.apple.Automator.application</string>
</dict>
</dict>
</plist>