Hi, my applescripting is rusty so any help would be greatly appreciated. I’m trying to create a droplet that will process folders of content to be used in Poser 2014 purchased via 3rd party merchants. It’s often a crapshoot whether or not the content is properly formatted to take advantage of Poser’s built-in content installer feature. When it’s not, you have to manually move a bunch of files/folders and it’s tedious. If it’s tedious, a computer should be able to do it for you, right?
The problem is the inconsistency of how content creators package their products. Typically a piece of purchased content will arrive in a folder called ‘Runtime’. There is a default folder structure for Runtime, and any content will contain at least one, if not all, of the expected folders. You just need to move the subfolders inside to their corresponding folder/subfolders in your Poser Content Library. The problem is often in the subfolders – that’s where things get inconsistent.
Here’s a basic folder structure of purchased content:
Runtime >
> Geometries
> Libraries
> Character
> BobCharacter
.... files files files
> Morphs
> BobCharacter
.... files files files
> Pose
> BobCharacter
.... files files files
> Textures
> BobCharacter
.... files files files
Poser has a content folder with Geometries, Libraries (>Character >Morph etc.), Textures, etc. and you just copy the custom folders (BobCharacter in the above example) to your Poser Content folder and maintain the folder structure.
Occasionally, however, you’ll get content with a folder structure where the merchant places the custom content inside an additional folder named after the artist, so like this:
Runtime >
> Geometries
> Libraries
> Character
>JaneContentArtist
> BobCharacter
.... files files files
> Morphs
>JaneContentArtist
> BobCharacter
.... files files files
> Pose
>JaneContentArtist
> BobCharacter
.... files files files
> Textures
>JaneContentArtist
> BobCharacter
.... files files files
This isn’t a problem unless you’ve already got other content by JaneContentArtist in your Poser Library, so the script would need to be able to respond to a “This file/folder already exists” error message and know to grab any files/folders inside the duplicate folder and move those items into the eponymous destination folder.
Here’s my first pass, but I keep getting an error (pasted below code snippet):
on open newRuntime
set subFolderCount to count folders of newRuntime
repeat with i from 1 to subFolderCount
set currentSubFolder to name of item i
set subSubFolderCount to count folders of currentSubFolder
repeat with j from 1 to subSubFolderCount
set currentSubSubFolder to name of item j
set destinFolder to "Macintosh HD:Users:Shared:Poser Pro 2014 Content:Downloads:Runtime:" & currentSubFolder & ":" & currentSubSubFolder
tell application "Finder"
try
move currentSubSubFolder to destinFolder
on error errMsg number errNum
if errNum = -15267 then
set currentSubSubSubFolderCount to count folders of currentSubSubFolder
set currentSubSubSubFolder to name of item 1 of currentSubSubFolder
set destinFolder to "Macintosh HD:Users:Shared:Poser Pro 2014 Content:Downloads:Runtime:" & currentSubFolder & ":" & currentSubSubFolder & ":" & currentSubSubSubFolder
tell application "Finder"
move currentSubSubSubFolder to destinFolder
end tell
end if
end try
end tell
end repeat
end repeat
end open
The error I get is "Can’t get folders of {alias “Macintosh HD…”} ----- (the path of the dropped folder).
Any ideas?
Many thanks!!