I’m unable to study the Xml components.
I made a bit of cleaning to the “pure” AppleScript part which behaves flawlessly.
-- Added Notes 9 folder support
set pathToApplicationSupport to path to application support from user domain as text # Edited according to StefanK's message
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 (pathToApplicationSupport & "Lotus Notes Data:")
set theCourseFolder to (pathToApplicationSupport & "Lotus Notes Data:" & folderName)
if (exists folder theTargetFolder) is false then
set theTargetFolder to (pathToApplicationSupport & "IBM Notes Data:")
set theCourseFolder to (pathToApplicationSupport & "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
For my own use I would drop the Xml instructions, save the code given above as an application and put it in the folder containing the nfs documents.
The person which will unzip the archive (zip file) will just have to double click the embedded script-application.
For test I saved the script as double click me.app
Source Folder :
/Users/myHome/Desktop/my Container/
double click me.app
2017-01-06T10.57.34.nsf
2017-01-06T11.01.03.nsf
After use :
/Users/myHome/Desktop/my Container/
double click me.app
Destination folder :
/Users/myHome/Library/Application Support/Lotus Notes Data/
folder name here
2017-01-06T10.57.34.nsf
2017-01-06T11.01.03.nsf
Yvan KOENIG running Sierra 10.12.2 in French (VALLAURIS, France) vendredi 6 janvier 2017 18:00:14