Profile Picture

My iClone Content Shortcuts Workflow

Posted By Delerna 6 Years Ago
Rated 5 stars based on 1 vote.
Author
Message
Delerna
Delerna
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
UPDATES

         16th April 2018 Replaced the Shortcuts Updater code so it now updates all shortcuts in the subfolders in the folder to update.
                                  Also removed some variables I used to have for functions I don't use anymore but forgot to remove the variable
                                  updates from the code. They are slashes and lvl.

                                  Also tried setting its colors a bit to make it a bit easier for low level programers to read it. Note those colors only apply here
         28th April 2018
Added code for a HTA app for altering file names in post 9. Its entitled UPDATING FILE NAMES

Introduction


I have posted a comment in another thread explaining how I use shortcuts for organising my content and there were a couple of people who seemed interested in it.
So I have decided I might as well share the software that I have written that helps to make it easier for me to organise them and make it easier to create them and change them.

I have 2 programs at the moment. 
     1) creates shortcuts from all the assets in the folder and its subfolders that I point it to. 
     2) One that helps me to reset the shortcut parameters if I change where I have saved the original content. 

I did this second one because I didn't like the way I set my content up when I started this but moving them to a new folder would mean all the shortcuts I have created would no longer work. 
So I would have to delete them all, recreate them, reorganise them and rename them....YUK. The other option is to edit the shortcuts so they point to the new location but doing that manually would take forever.

If you want these programs, you are welcome to have them. They are just HTML/VBScript code created in HTA files so they are very easy to adjust especially if your a little bit familiar with web development.
I intend to improve them in the future and replace the code I place here. I will also try and describe how it works as best I can. Especially if I see that people are interested in this. 

Feel free to comment, I have enough posts for what I am adding


i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Edited
6 Years Ago by Delerna
Delerna
Delerna
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
SHORTCUT PARAMETERS UPDATER

So here are some basics of how It works for a user.
In the bottom half of the image is the application. In that The Folder To Update is the folder that has the shortcuts that you want to update their parameters in.
There is also an include subfolders tickbox but that is not constructed yet. I will get that working soon

 The top half is a display of the folder I have entered and as you can see the contents icons are not displayed because I moved their contents to a new folder. 
After clicking the VIEW button the application displays all the shortcuts within the folder to update as well as the target the shortcuts are pointing to. 
These are what need to be changed and the text that needs to be changed is in the Text To Replace option. The Replacement Text is the text that will replace the Text To Replace when you click the update button. When the edit button gets clicked it updates all the shortcuts for their Target and the workspace parameters

https://forum.reallusion.com/uploads/images/a7264c5b-fb45-4848-ab08-d8ac.png



This second image shows how all the shortcuts are now updated and you can see that because the contents icons are now being displayed again


https://forum.reallusion.com/uploads/images/48c4d56c-eba2-4f97-8e6e-fde5.png



For the code all you should need to do, and I'm going to test it soon just to make sure. 
All you need to do is copy it. Create a text file where you want it and rename it to something like  ShortcutUpdater.hta  Note: You must have windows set to show the file extensions in order to do that so it works
Googling it should help you to do it but I will show how if it gets requested

Once you have created the text file and named it you need to edit it with a basic text editor. I use Notepad++ because its free.
Open it in the editor and past the code save and close it. Now you should be able to double click it and it should execute like the images display

The next post will be a description about how the code works so it will help you to know how to change things so it fits your file setups better.
I am trying to make these changes as easy as possible. I'm not sure if its just my opinion or it is really true but I see web development and VBS to be quite easy to learn.
Saying that because if you don't know that stuff but it interests you then this may be something that will help you learn it? Don't forget google. My best friend for things I want to discover

Also, you really should check out the software before you run it. Just so you can be sure I am not doing something to rip you off or hurt your computer.
I promise to you that I am not doing any of that but you should never blindly believe what someone says. Especially with software they are giving away.


OK, I have downloaded the code, put it into a new text file reset to .hta and it got errors but the messages tells the lines where the errors are. There are 2 errors and if you check the code here you will notice there are 2 faces.  They are supposed to be ) and they have been changed to yellow faces.  You just need to add the ) to the end of the line where the error occurs in the text file
Actually, I just noticed that typing the ) here didn't show up as faces. So I deleted them and retyped them into the code and the faces disappeared.
I recopied this code and replaced the previous trials code with this code and it worked with no error. I will test it does the updates soon

OK, I have done an actual update now from the code I copied from here and everything worked fine. So hopefully it will work for you also
Now I need to adjust my shortcut creator version so it works similar to this. This one I started writing today so the other one shouldn't take too long

I have tried coloring the code a little bit, I thought it might make it a bit easier for people to follow
Red is HTML, green is styles for HTML objects and blue is the VB script.
I also adjusted the color levels to show separate parts. For example Darkest blue shows the start and end of subroutines and the light stuff between them is the code the executes when the sub is called.
I have also set the text you need to change to suit your own setup to yellow. Everything else can stay as it is unless you know how to program and want to make your own improvements
Sub means subroutine by the way

HERE IS THE CODE

<html>
<head>

<style>

   table{width:100%; border-collapse:collapse; border: 0px solid white; height:100% }
   td {padding:3px; border-spacing:100px; border: 1px solid black;vertical-align:top; font-size:xx-small; }
   input.inTbl{width:100%;border: 0px solid red;}
   input.btn{width:100%;}

</style>
<script language=vbscript>

dim WshShell,fso
dim td1,td2,td3,td4
'dim td5
dim DefaultReplacementText,TextToReplace,OriginalReplacementText,ReplacementText
dim ShortcutsBaseFolder,retchanged


Sub Window_OnLoad()
 ShortcutsBaseFolder="E:\02 IClone\"
 DefaultReplacementText="E:\Reallusion\Template\ContentPacks"

 set WshShell = CreateObject("Wscript.shell")
 set fso = CreateObject("Scripting.FileSystemObject") 
 set td1=document.getElementById("tdFiles") : set td2=document.getElementById("tdResults") : set td3=document.getElementById("tdPath") 
 set td4=document.getElementById("tdWork") ': set td5=document.getElementById("tdFolder")
 document.getElementById("txtFileLocation").value="E:\02 IClone\1ContentShortcuts\20) Celestial\Alians"

end sub

sub window_onunload()
 set td1=nothing : set td2=nothing : set td3=nothing : set td4=nothing ': set td5=nothing
 set WshShell = nothing : set fso=nothing

end sub

sub View()
 td1.innerHTML="" : td2.innerHTML="" : td3.innerHTML="" : td4.innerHTML="" ': td5.innerHTML=""
 document.getElementById("txtTextToReplace").value=DefaultReplacementText
 DoTheView(document.getElementById("txtFileLocation").value)

end sub

Sub DoTheView(FileSpec)
 
 set fldr=fso.GetFolder(FileSpec)
 for each fle in fldr.Files
  if fle.type="Shortcut" then
   td1.innerHTML=td1.innerHTML & fle.name & "<br>"
   Set oLnk = WshShell.CreateShortcut(fle.path)
   td2.innerHTML=td2.innerHTML & oLnk.TargetPath & "<br>"
   Set oLnk=nothing
  end if
 next
 
 if document.getElementById("chkIncludeSubfolders").checked then  
    For Each Subfolder in fldr.SubFolders
    DoTheView Subfolder.Path   
    Next
 end if
 set fldr=nothing

end sub

sub Update()
 td3.innerHTML="" : td4.innerHTML="" ': td5.innerHTML=""
 TextToReplace=document.getElementById("txtTextToReplace").value  
 ReplacementText=document.getElementById("txtReplacementText").value  
 OriginalReplacementText=trim(ReplacementText)
 if trim(TextToReplace)<>"" then
  td1.innerHTML="" : td2.innerHTML="" : td3.innerHTML="" : td4.innerHTML="" ': td5.innerHTML=""
  DoTheUpdate(document.getElementById("txtFileLocation").value)
 else
  msgbox "You must enter at least the TextToReplace to do an update"
 end if

end sub

sub DoTheUpdate(FileSpec)
 set fldr=fso.GetFolder(FileSpec)
 for each fle in fldr.Files
  if fle.type="Shortcut" then
   td1.innerHTML=td1.innerHTML & fle.name & "<br>"
   Set oLnk = WshShell.CreateShortcut(fle.path)
   td2.innerHTML=td2.innerHTML & oLnk.TargetPath & "<br>"
   
   tp=oLnk.TargetPath
   if instr(tp,TextToReplace)<>0 then 
    if trim(OriginalReplacementText)="" then ReplacementText=ShortcutsBaseFolder & getSourceFolder(tp)
    tp=replace(tp,TextToReplace,ReplacementText)
    if left(tp,1)<>"""" then tp="""" & tp
    if right(tp,1)<>"""" then tp=tp & """"
    td3.innerHTML=td3.innerHTML & tp & "<br>"    
    wd=tp
    while right(wd,1)<>"\"
     wd=left(wd,len(wd)-1)
    wend 
    wd=left(wd,len(wd)-1)
    wd=right(wd,len(wd)-1)
    td4.innerHTML=td4.innerHTML & wd & "<br>"
    oLnk.TargetPath=tp    
    oLnk.WorkingDirectory=wd
    oLnk.Save    
   else
    td3.innerHTML=td3.innerHTML & "not updated<br>"
    td4.innerHTML=td4.innerHTML & "not updated<br>"
   end if
   Set oLnk=nothing
  end if
 next
 
 if document.getElementById("chkIncludeSubfolders").checked then  
    For Each Subfolder in fldr.SubFolders
    DoTheUpdate Subfolder.Path   
    Next
 end if
 set fldr=nothing  

end sub


function getSourceFolder(loc)
 ret="Reallusion"
 retchanged=false
 ret=checkThis(loc,ret,"3DEverything","Marketplace")
 ret=checkThis(loc,ret,"4u2ges","Marketplace")
 ret=checkThis(loc,ret,"Alley","Marketplace")
 ret=checkThis(loc,ret,"BenjaminTuttle","Marketplace")
 ret=checkThis(loc,ret,"BigBoss","Marketplace")
 ret=checkThis(loc,ret,"BiggsTrek","Marketplace")
 ret=checkThis(loc,ret,"Colonel_Klink","Marketplace")
 ret=checkThis(loc,ret,"ColonelKlink","Marketplace")
 ret=checkThis(loc,ret,"Delerna","Marketplace")
 ret=checkThis(loc,ret,"Dexsoft","Marketplace")
 ret=checkThis(loc,ret,"Dicho","Marketplace")
 ret=checkThis(loc,ret,"Duchess","Marketplace")
 ret=checkThis(loc,ret,"GrannyJ","Marketplace")
 ret=checkThis(loc,ret,"Guppi","Marketplace")
 ret=checkThis(loc,ret,"Irina","Marketplace")
 ret=checkThis(loc,ret,"NL2012","Marketplace")
 ret=checkThis(loc,ret,"Nova","Marketplace")
 ret=checkThis(loc,ret,"owenssj","Marketplace")
 ret=checkThis(loc,ret,"Peteradam6","Marketplace")
 ret=checkThis(loc,ret,"Protofactor","Marketplace")
 ret=checkThis(loc,ret,"QTheory","Marketplace")
 ret=checkThis(loc,ret,"Quantam","Marketplace")
 ret=checkThis(loc,ret,"Sen","Marketplace")
 ret=checkThis(loc,ret,"SinisterGames","Marketplace")
 ret=checkThis(loc,ret,"Texoma","Marketplace")
 ret=checkThis(loc,ret,"TheBizMovies","Marketplace")
 ret=checkThis(loc,ret,"ToKoMotion","Marketplace")
 ret=checkThis(loc,ret,"Unknown","Marketplace")
 ret=checkThis(loc,ret,"Warlords","Marketplace")
 ret=checkThis(loc,ret,"Wengi","Marketplace")
 ret=checkThis(loc,ret,"Wensk","Marketplace")
 ret=checkThis(loc,ret,"WVeek","Marketplace")
 ret=checkThis(loc,ret,"HDRIHaven","ExteriorStores")
 ret=checkThis(loc,ret,"iCloneZero","ExteriorStores")
 ret=checkThis(loc,ret,"KernalTopal","ExteriorStores")
 ret=checkThis(loc,ret,"Mixamo","ExteriorStores")
 'if not retchanged then td5.innerHTML=td5.innerHTML & "not changed<br>"
 getSourceFolder=ret

end function

function checkThis(loc,ret,nme,newRet) 
 if instr(loc,nme)<>0 then
  retchanged=true
  ret=newRet
  'td5.innerHTML=td5.innerHTML & nme & "<br>"
 end if
 checkThis=ret

end function
</script>
</head>
<body>
 <table>
  <tr><td>
   <table id=tblFilters>
    <tr style='background-color:steelblue;color:white;'><td>Common Words</td><td colspan=5 style='color:yellow;'>
    E:\02 IClone\&nbsp;&nbsp;&nbsp;ExteriorStores&nbsp;&nbsp;&nbsp;Marketplace&nbsp;&nbsp;&nbsp;Reallusion
    </td></tr>
    <tr style='background-color:steelblue;color:white;'>
     <td width='1%' nowrap>Folder To Update</td>
     <td colspan=3><input type=text class=inTbl id=txtFileLocation /></td>
     <td width='1%' nowrap>Include Subfolders<input type=checkbox id=chkIncludeSubfolders /></td>
     <td rowspan=2 width='1%'><input type=button class=btn onclick=View() value=VIEW /><br><input type=button class=btn onclick=update value=UPDATE /></td>
    </tr>   
    <tr style='background-color:steelblue;color:white;'>
     <td>Text To Replace</td>
     <td width='50%'><input type=text class=inTbl id=txtTextToReplace /></td>
     <td width='1%' nowrap>Replacement Text</td>     
     <td colspan=2><input type=text class=inTbl id=txtReplacementText /></td>
    </tr>
   </table>

  </td></tr>
  <tr><td height='98%'>
   <table >
    <tr style='background-color:steelblue;color:white;height:1%;text-align:center;'>
     <td width='1%' nowrap>File Name</td>    
     <td width='30%' nowrap>Shortcuts Current Target</td>
     <td width='30%' nowrap>Shortcuts New Target</td>
     <td width='30%' nowrap>Shortcuts New Work Directory</td>
     <!--td width='1%' nowrap>Folder</td-->     
    </tr>
    <tr>
     <td id=tdFiles width='1%' nowrap></td>    
     <td id=tdResults width='30%' nowrap></td>
     <td id=tdPath width='30%' nowrap></td>
     <td id=tdWork width='30%' nowrap></td>
     <!--td id=tdFolder width='1%' nowrap></td-->     
    </tr>
   </table>

  </td></tr>
 </table>

</body>
</html>



i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Edited
6 Years Ago by Delerna
Delerna
Delerna
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
CODE DESCRIPTION FOR           SHORTCUT PARAMETERS UPDATER

WEB PAGE BASICS

Only speaking in reference to this program here. There is much more detail involved with web development but I'm only covering what is needed to try and help you understand these programs. I always try to explain things with basic words. I steer clear of using the words most professional use to explain things. Using as simple as possible wording helps beginners to understand things more easily....That's what I believe. Also I will keep this description as basic as possible. There is several things I wont describe because they are so basic that google will help answer questions.  Any if this interests you and you have questions you want to ask me then please ask here. I will answer as best as I can.

HTA
HTA stands for hypertext applications. It is a way that Microsoft has given us to use their web browsers so we can create visual user interfaces for visual basic scripting (VBS). So hypertext is the language we can develop in text editor programs for creating webpages and VBS a language we can use in text editors for creating code to do all kinds of work on our computers. However .vbs files written with text editors don't have graphical ways of displaying what it is doing. So we can use webpage development and add our VBS code into it to create programs that can do work on our computers and display anything we want using the web browsers capabilities. All we need to do is give it the .hta file extension and all the security functions in the web browser the disallows things being done on our computers gets disabled.
What this means is if we used .htm or .html as the file extension then the browser will treat it as a web page and disallow all the things my program is doing so your computer can be secure on the intranet. Using .hta tells the browser it is a computer program and not a webpage so trust what it wants to do to our computer. This means we now have all the graphics abilities of web pages to control what our VBS files can do.

HTML BASICS
<html>
   <head>
          <style>web page style controls here</style>
          <script>Vb scripting goes here</script>
   </head>
   <body>
       web page visuals and text goes here. I use web tables for the most part for the VBS controls and results to get displayed in
       EG
      <table> is the start of a table
      <tr> is the start of a row in the table
      <td> is the start of a cell in the row
      </td> is the end of a cell in the row
      </tr>is the end of a row in the table
     </table> is the end of the table
     Some of these have id's added to the starting element. 
     These give us a way to access them from the VBS so we can read and write things into them
   </body>
</html>

So in my code you should notice the <body>coding</body> is at the bottom half of my total code and this is where I added the things you can see when you run the program. 
The <script>VBS</script> is in the top half of my total code and this is the programming that does all the work for updating the files

THE VBS CODE
THE DIMS AT THE TOP

These are variables that can store information about whatever we want to store that can then be accessed and used anywhere in the VBS coding.
SUB WINDOW_ONLOAD()
The code in here (between SUB and END SUB gets executed when you double click the hta file.
It mostly sets things up ready for use.
at the bottom of this sub is document.getElementById("txtFileLocation").value="E:\02 IClone\0ContentShortcuts\20) Celestial"
This is what gets displayed in the  Folder to update cell by default and this can be chaged by copying and pasting the folder location for the shortcuts you want to update.

ShortcutsBaseFolder  holds the folder where I keep all of my contents and shortcuts now. It saves me having to enter it all the time.
                                   You should change it to yours in a text editor and save it. You can always change it and save it anytime.
                                   The primary thing about this is that it is the starting point of where all my contents are now.
DefaultReplacementText This is the place where I had all my contents saved at before I moved them so all the shortcuts will currently  have                                         that and that is probably what will need to be changed. It gets displayed in the web pages text to replace cell by default
                                    when you press the view button. The names of all the files and their file target gets displayed 
                                    If any of the files displayed have a different location than the default then you can select and copy from that list the text
                                    that needs to get changed and past that into the text to replace cell

SUB VIEW()

                    This is what gets executed when you click the VIEW button. Shouldn't need to change anything there but if you want to go ahead

SUB UPDATE()
                   This is what gets executed when you click the UPDATE button
                   If ever you want to run this without actually updating them then you can rem these 3 lines out by putting a ' at the front of them
    oLnk.TargetPath=tp   
    oLnk.WorkingDirectory=wd
    oLnk.Save    
                   The program will act as if it is updating everthing but it really isn't.

                   Part of this is the ReplacementText cell. What you type into that is what the text in the Text To Replace cell will get changed to
                   when the shortcuts target and work directory properties get updated to. You may always enter something there and everything
                   should get updated according to what you have typed into the tables cells.

Finally there are 2 functions.
getSourceFolder and checkThis
                  Neither of these will get executed unless you leave the ReplacementText cell empty.
                  This is something I added to make it so I don't have to do too many updates.
                  IE, I can update many variation all at the same time based off words that are entered into the files locations
                  You may at may not have set yours up like mine so this may not be usefull for you?
                  All contents I buy are saved into folders named to where I bought them from.
                  All reallusion's contents are in a folder named reallusion.
                  All marketplace contents are in a folder called Marketplace
                  All contents I get from somewhere else are in a folder I called ExteriorStores
                  The Marketplace and ExteriorStores contents are saved in folders named by the person I bought it from 
                  The reallusion contents are saved in folders named by the name of the packs that I purchased.
                  This was one of the primary changes I made to where the contents are now saved
                  So, the getSourceFlolder is what I added so the code could check if marketplace developers names are in the shortcuts path
                  if it is it knows it needs to add Marketplace into the replacement text
                  if it has a name from an external store it knows it needs to add ExternalStore to the replacement text
                 if it doesn't have any of those then it knows to add Reallusion to the replacement text.

Hope that gives you enough details to figure out how it works.
As stated. This only gets done if you leave the ReplacementText cell empty.
If you want to use this you will definitely need to change the getSourceFolder function to suit how you set your folders up.
In the code it is line 67 in the DoTheUpdate SUB that controls whether these functions get called or not

Hope this help, any questions and I will try and answer. Just be as clear and detailed on your question as you can. That will help me understand what your asking



i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Edited
6 Years Ago by Delerna
Delerna
Delerna
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
SHORTCUTS CREATER

OK Here is the shortcuts creator. The coding is a lot simpler than the updater

In the first image Up the top are the folders and files. Down the bottom is the application
It lists the source folder that has the contents you want to create shortcuts from. That is shown in the folders display on the left
The next applications setting is the Flolder where you want the shortcuts to be created to 
The folders display in the middle shows that the folder does not exist yet.
Once the source and destination folders have been added all we need to do is click the create button which is shown in the 2nd image

https://forum.reallusion.com/uploads/images/74f9097b-5760-45dc-ab67-ff50.png




In the second image you can see the result of clicking the create button.
Notice in the middle folder display that the folders got created automatically. We don't need to manually create them
Also I didn't tick the subfolders tickbox so the only thing that gets shortcutted are the files in the source folder and nothing from the subfolders there
Also, because the file there is an iMotion an Motions folder got automatically created and the shortcut got added in there, as you can see in the folders image on the right

https://forum.reallusion.com/uploads/images/0cd2c930-0544-4d0d-8f1f-a537.png


This 3rd image shows the results when the include subfolders is ticked.
again It creates folders named for the type of content the shortcut gets created for and the shortcuts all have the same name as the target file. I just did that so I can easily see what type of content the shortcut is linked to. In the next post I will describe how the code works and you should find it relatively easy to adjust it to suit your own desires on how these should work

https://forum.reallusion.com/uploads/images/c45b79d1-3c7e-498c-aa8b-8f6b.png



I will test the code again and then I'm going to bed.
I will describe the code tomorrow. Not as much as the previous one because they are very similar. But I will describe the key points for creating  shortcuts.
Also not. These codes can be adjusted to work with other files besides these.
Things like renaming files. Moving files, copying files. It makes working with many files much easier and quicker than doing it manually
Manually on a few files is easier than this. But working with lots of files especially if its something you do regularly this sort of coding can help a lot.

OK copied and pasted the code and executed it and it all worked for me


HERE IS THE CODE
<html>
<head>
<style>

table{width:100%; border-collapse:collapse; border: 0px solid white; height:100% }
td {padding:3px; border-spacing:100px; border: 1px solid black;vertical-align:top; font-size:xx-small; }
input.inTbl{width:100%;border: 0px solid red;}
input.btn{width:100%;}

</style>
<script language=vbscript>

dim WshShell,fso
dim SourceFolder,DestinationFolder,slashes,lvl

Sub Window_OnLoad()
 SourceFolder="E:\02 IClone\Reallusion\3D VFX - Motion Montage Vol. 1"
 DestinationFolder="E:\00000Test\Shortcuts"
 set WshShell = CreateObject("Wscript.shell")
 set fso = CreateObject("Scripting.FileSystemObject") 
 document.getElementById("txtSourceFolder").value=SourceFolder
 document.getElementById("txtDestinationFolder").value=DestinationFolder
end sub
sub window_onunload()
 set WshShell = nothing : set fso=nothing

end sub

sub create()
 SourceFolder=document.getElementById("txtSourceFolder").value
 DestinationFolder=document.getElementById("txtDestinationFolder").value
 if trim(SourceFolder)<>"" and trim(DestinationFolder)<>"" then
  checkFoldersExist()
  createShortcuts(SourceFolder)
  msgbox "Done"
 else
  msgbox "You must define both source and destination folders to create the shortcuts"
 end if

end sub
sub createShortcuts(FileSpec)
   'ReDim Preserve arry(intSize + 1)
   set fldr=fso.GetFolder(FileSpec)
  
   slashes = slashes & "/"
   lvl=lvl & fldr.name & slashes
  
   for each fle in fldr.Files
      select case lcase(mid(fle.name,instr(fle.name,"."),20))
      case ".iproject" : createThisShortcut DestinationFolder & "\Projects",fle.path,fle.name
      case ".iavatar" : createThisShortcut DestinationFolder & "\Avatars",fle.path,fle.name 
      case ".iupper" : createThisShortcut DestinationFolder& "\Avatars" ,fle.path,fle.name 
      case ".ilower" : createThisShortcut DestinationFolder& "\Avatars" ,fle.path,fle.name  
      case ".ishoe" : createThisShortcut DestinationFolder& "\Avatars" ,fle.path,fle.name  
      case ".ivns" : createThisShortcut DestinationFolder & "\Avatars",fle.path,fle.name
      case ".vns" : createThisShortcut DestinationFolder & "\Avatars",fle.path,fle.name 
      case ".imotion" : createAnimShortcut DestinationFolder & "\Motions",fle.path,fle.name 
      case ".iprop" : createThisShortcut DestinationFolder & "\Props",fle.path,fle.name
      case ".iacc" : createThisShortcut DestinationFolder & "\Accessories",fle.path,fle.name  
      case ".ihair" : createThisShortcut DestinationFolder & "\Hair",fle.path,fle.name  
      case ".wmv" : createThisShortcut DestinationFolder & "\MovieClips",fle.path,fle.name 
   case ".mp4" : createThisShortcut DestinationFolder & "\MovieClips",fle.path,fle.name 
      case ".avi" : createThisShortcut DestinationFolder & "\MovieClips",fle.path,fle.name  
   case ".popvideo" : createThisShortcut DestinationFolder & "\MovieClips",fle.path,fle.name 
   case ".iterrain" : createThisShortcut DestinationFolder & "\Terrain",fle.path,fle.name 
   case ".isky" : createThisShortcut DestinationFolder & "\Sky",fle.path,fle.name
   case ".iface" : createThisShortcut DestinationFolder & "\Face",fle.path,fle.name 
   case ".imtl" : createThisShortcut DestinationFolder & "\Images",fle.path,fle.name
   case ".tga" : createThisShortcut DestinationFolder & "\Images",fle.path,fle.name
   case ".tif" : createThisShortcut DestinationFolder & "\Images",fle.path,fle.name
   case ".nfo" : s=""
   case ".exe" : s=""
   case ".txt" : s=""  
   case ".aep" : s=""   
   case ".lnk" : s=""  
   case ".jpg" : s="" 
   case ".jpeg" : s="" 
   case ".png" : s=""  
   case ".gif" : s=""  
   case ".ini" : s=""   
   case ".zip" : s=""  
   case ".db" : s=""  
   case ".wav" : createThisShortcut DestinationFolder & "\Audio",fle.path,fle.name  
      case else : createThisShortcut DestinationFolder,fle.path,fle.name
   end select
      next  
   if document.getElementById("chkIncludeSubfolders").checked then
    For Each Subfolder in fldr.SubFolders
    createShortcuts Subfolder.Path
    Next
   end if
      slashes=left(slashes,len(slashes)-1)
      lvl=left(lvl, instr(lvl,slashes) + (len(slashes)-1) )
  

end sub
sub createAnimShortcut(pth,lnk,nme)
 if not fso.FolderExists(pth) then
  fso.CreateFolder(pth)
 end if
    fldr=""  
    s=slashes : l=lvl : l=replace(l,s,"") : s=left(s,len(s)-1)
 f=mid(l,instr(l,s) + len(s),1000)
    if lcase(f)="idle" or lcase(f)="move" or lcase(f)="perform" then
    fldr="\" & f 
    l=replace(l,s & f,"")
    s=left(s,len(s)-1)
    f=mid(l,instr(l,s) + len(s),1000)
 end if
   set objShortcut = WshShell.CreateShortcut(pth & fldr & "\" &  nme & ".lnk")
   objShortcut.TargetPath = lnk
   objShortcut.WorkingDirectory=pth
   objShortcut.Save

end sub
sub createThisShortcut(pth,lnk,nme)
 if not fso.FolderExists(pth) then
  fso.CreateFolder(pth)
 end if
   set objShortcut = WshShell.CreateShortcut(pth & "\" & nme & ".lnk")
   objShortcut.TargetPath = lnk
   objShortcut.WorkingDirectory=pth
   objShortcut.Save

end sub





sub checkFoldersExist()
 tst=DestinationFolder
 flderToCreate=""
 disk=left(tst,instr(tst,":\"))
 tst=replace(tst,disk & "\","")
 while instr(tst,"\")<>0  
  fldr=left(tst,instr(tst,"\")-1)
  flderToCreate=flderToCreate & "/" & fldr
  tst=replace(tst,fldr,"")
  if not fso.FolderExists(disk & flderToCreate) then
   fso.CreateFolder(disk & flderToCreate)
  end if
  if left(tst,1)="\" then tst=right(tst,len(tst)-1)
 wend
 flderToCreate=flderToCreate & "/" & tst
 if not fso.FolderExists(disk & flderToCreate) then
  fso.CreateFolder(disk & flderToCreate)
 end if

end sub
</script>
</head>
<body>
 <table>
  <tr><td>
   <table id=tblFilters>
    <tr style='background-color:steelblue;color:white;'>
     <td width='1%' nowrap>Source Folder</td>
     <td colspan=3><input type=text class=inTbl id=txtSourceFolder /></td>
     <td width='1%' nowrap>Include Subfolders<input type=checkbox id=chkIncludeSubfolders /></td>
     <td rowspan=2 width='1%'><!--input type=button class=btn onclick=View() value=VIEW /><br--><input type=button class=btn onclick=create() value=CREATE /></td>
    </tr> 
    <tr style='background-color:steelblue;color:white;'>
     <td width='1%' nowrap>Destination Folder</td>
     <td colspan=3><input type=text class=inTbl id=txtDestinationFolder /></td>
     <td width='1%' nowrap></td>
    </tr>    
   </table> 

  <tr><td height='98%'>

   <table > 
   </table>

  </td></tr>   
 </table>  

</body>
</html>







i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Edited
6 Years Ago by Delerna
Delerna
Delerna
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
CODE DESCRIPTION FOR              SHORTCUTS CREATER

OK again there is a sub Window_OnLoad where you can enter the default source and destination folders that suits your method rather than mine. This just saves you the need of entering them everytime you start the program. After starting the program you can easily change these if you need a different flolder than the default. Just click in the cell you want to change, delete what's in it and type (or copy and paste) the folder path you need to access

Oh and same with the other program, the sub window_onunload closes the objects that were created through the set statement 
EG      set fso=CreateObject("Scripting.FileSystemObject")    
This creates  visual basic script (VBS) an object called fso that is used for working with disks, folders and files.
setting it to nothing when the program closes releases the computers memory that it was using.
Oh, and doing that is not so important these days. I have been doing it like that for so long I am so used to doing it so I just keep doing it. Besides, I think its safer to do it myself rather than rely on the computers operating system to do it for me. LOL

The sub Create gets called when we click the create button. It checks if you have entered a source and destination before doing the create. Maybe I should also have added a check that you entered a source folder that really exist as well as you used \ and not / for the paths slashes.  Maybe I will add those later

in the sub createShortcuts is a list of specific files I want to create shortcuts for as well as specific files I don't want to create shortcuts for. You may need to adjust it to suit what you want to create shortcuts for
It is this bit

      select case lcase(mid(fle.name,instr(fle.name,"."),20))
      case ".iproject" : createThisShortcut DestinationFolder & "\Projects",fle.path,fle.name
                  etc etc    all the ones I want to create shortcuts for
      case ".nfo" : s=""
                  etc etc    all the ones I don't want to create shortcuts for
      case else : createThisShortcut DestinationFolder,fle.path,fle.name
                  the line above this comment creates a shotcut for anything else that is not in the 2 lists above

   end select



The subCheckFoldersExist at the bottom is what creates the folders in your destination that don't exist


i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Edited
6 Years Ago by Delerna
Delerna
Delerna
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
DOWNLOADING CONTENT

Here are a couple of images with descriptions of what I do for downloading new content I buy.

As I said in the original post on this. This is just how I do it and may not be how you want to do it. We all should do things in methods that suits ourselves.
The primary reason I do it this way is so I can download new contents and it is easy for me to find them. I don't need to read the contents document that is available when the download compleats.
Everything that got downloaded is in a totally separate file so the downloaded contents are the only thing in it. For me that makes it easiest to know exactly what got downloaded.


Here are the description images for my method. If this sort of thing interests you then you will need to figure out how you want to do it to suit yourself and your own workflow
Its just how I currently desire to do it
https://forum.reallusion.com/uploads/images/55fadcef-68e0-496f-9964-84b7.png




https://forum.reallusion.com/uploads/images/fa674a8f-b6e7-4437-af1d-3f85.png




i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Edited
6 Years Ago by Delerna
Delerna
Delerna
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
ORGANISING SHORTCUTS

I just discovered an issue for my organisation method now. The issue is here after I updated iClone Yesterday. I will show it towards the end of this post


Here is an image that shows how I organise my shortcuts. I don't organise them by their file types. Rather I try to organise them by what they are.
That way I have all characters in the same folder regardless whether they are .iAvatar or iProp. I then Have folders in the characters folder for Monsters, Humans, Aliens, etc etc
I also have Folders in the Reallusion/Template/iClone7 Template/ folder that I can rename to iClone Template after renaming the original one first. I use these for specific projects I work on so there is not too many contents that causes iClone to work slowly as I look for contents through iClones user interface while I am working on that project. I just copy the shortcuts I need for the project and add them to its folder.
Hope I said that clear enough

https://forum.reallusion.com/uploads/images/001c3f09-47f3-41c6-a5b9-2fd5.png






OK I was going to show a way for putting shortcuts into iclones folders without having to copy all the shortcuts. Reater create a shortcut to the folder that has all the shortcuts I want in there like I showed Here
However, after updating iClone yesterday it no longer works with shortcuts of folders. Only shortcuts to contents work now.
Did they see my post and decide to disable it? I hope not. I think the changes have accidentally bugged that option. I hope so. Gonna post this bug in feedback tracker and hope they fix it.



As you can see in this image I have folder shortcuts in iclones characters folder. to the folders where I have my shortcuts saved. 
They used to show up in iClone as folders but now they don't after updating iclone.
Only the content shortcut shows up now, the folder shortcuts are there but are unuseable.
Its not a huge issue if they don't fix it. I can just copy the folders I want into iclones folders. It just means all the shortcuts will get duplicated where as using a folder shortcut meant they didn't get duplicated.
Saves a bit of disk space but they are only shortcuts to the actual content so duplicating them doesn't use up as much disk space as duplicating the actual contents. This is one of the main reasons I do this.
I can duplicate and rename the shortcuts all I want without taking up too much space and without effecting the original contents.


https://forum.reallusion.com/uploads/images/d1bad15b-5208-4b79-a1c1-1d3d.png


i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Edited
6 Years Ago by Delerna
Delerna
Delerna
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
Upcomming doco

i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Delerna
Delerna
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
UPDATING FILE NAMES
Here is a HTA file that gives me 3 option to change file names
      1) Add some new text into the start of all files in a folder and its subfolders
      2) Add some new text into the end of the files names  for all files in a folder and its subfolders

As an example of what I use those 2 for. I might want to be able to tell what version my characters are. For example G2, G3, G4, G5, CC etc. So I put all my G2 Characters together and add G2 to the end  or the start of the file name. Then I can put them back all together and can see what versions they are. I decide whether to put it at the start or the end depending on how I want them sorted.


      3) Replace a part of the files name with something else

Here is an example. I was creating some contents and named them with Int or Ext as to whether they are Internal or External props. Ended up with too many so created a folder for internals and another folder for externals. Rather than having to go through each file and remove Int and Ext from their names I use the Replace text option
Enter Ext+ as text to replace and + as Text To Add. Click update and they all got renamed.

Don't know if any of you will find this useful or not?
If you try it I highly recommend that you copy some folders and their files to another location and try the updating on them so if anything goes wrong on your computer it wont destroy your files. It works fine on my computer with no problems. Just suggesting you do this at first just so you can be safe and get confident it works for you

https://forum.reallusion.com/uploads/images/f2378cf5-a13a-4059-bf86-9256.png







HERE IS THE CODE
<html>
<head>
<style>

table{width:100%; border-collapse:collapse; border: 0px solid white; height:100% }
td {padding:3px; border-spacing:100px; border: 1px solid black;vertical-align:top; font-size:xx-small; }
input.inTbl{width:100%;border: 0px solid red;}
input.btn{width:100%;}

</style>
<script language=vbscript>
dim WshShell,fso
dim SourceFolder,textToReplace,newText,slashes,lvl,updateMethod
dim td1,td2
Sub Window_OnLoad()
 SourceFolder="E:\Reallusion\Custom\iClone 7 Custom\Props\Modular\Basic Shapes"
 set WshShell = CreateObject("Wscript.shell")
 set fso = CreateObject("Scripting.FileSystemObject") 
 document.getElementById("txtSourceFolder").value=SourceFolder
 set td1=document.getElementById("tdFiles")
 set td2=document.getElementById("tdResults")

end sub
sub window_onunload()
 set td1=nothing : set td2=nothing
 set WshShell = nothing : set fso=nothing

end sub
sub view()
 td1.innerHTML="" : td2.innerHTML=""
 SourceFolder=document.getElementById("txtSourceFolder").value
 if trim(SourceFolder)<>"" then
  showFiles(SourceFolder)
 else
  msgbox "You must define the source folder to show the file names"
 end if

end sub
sub showFiles(FileSpec)
   set fldr=fso.GetFolder(FileSpec)
   slashes = slashes & "/"
   lvl=lvl & fldr.name & slashes
   
   for each fle in fldr.Files
   td1.innerHTML=td1.innerHTML & fle.name & "<br>"
   'td2.innerHTML=td2.innerHTML & fileExtension(fle.name) & "<br>"
   next 
   if document.getElementById("chkIncludeSubfolders").checked then
   For Each Subfolder in fldr.SubFolders
   showFiles(Subfolder.Path)
   Next
   end if
      slashes=left(slashes,len(slashes)-1)
      lvl=left(lvl, instr(lvl,slashes) + (len(slashes)-1) )  

end sub
sub update()
 td1.innerHTML="" : td2.innerHTML=""
 SourceFolder=document.getElementById("txtSourceFolder").value
 textToReplace=document.getElementById("txtReplaceText").value
 newText=document.getElementById("txtAddText").value
 updateMethod=document.getElementById("cboType").value
 if trim(SourceFolder)<>"" and trim(newText)<>"" then
  if updateMethod=3 and trim(textToReplace)="" then
   msgbox "You need to enter the text you want to replace"
  else
   updateFiles(SourceFolder)
   msgbox "Done"
  end if
 else
  msgbox "You must define the source folder and the text to add to change the file names"
 end if

end sub
sub updateFiles(FileSpec)
 
 set fldr=fso.GetFolder(FileSpec)
 slashes = slashes & "/"
 lvl=lvl & fldr.name & slashes
  
 for each fle in fldr.Files
  fn=fle.name
  typ=fileExtension(fle.name)
  select case updateMethod
   case 1: fnTo=newText & fn
   case 2:
    fnTo=replace(fn,typ,"") & newText & typ
   case 3
    fnto=""
    if instr(fn,textToReplace)<>0 then
     fnto=replace(fn,textToReplace,newText)
    end if
  end select
  td1.innerHTML=td1.innerHTML & fn & "<br>"
  td2.innerHTML=td2.innerHTML & fnTo & "<br>"
  if updateMethod<>3 or (updateMethod=3 and instr(fn,textToReplace)<>0) then  
   nn=fle.ParentFolder & "\" & fle.name
   fso.GetFile(nn).Name = fnTo
  end if
 next 
 if document.getElementById("chkIncludeSubfolders").checked then
  For Each Subfolder in fldr.SubFolders
   updateFiles(Subfolder.Path)
  Next
 end if
 slashes=left(slashes,len(slashes)-1)
 lvl=left(lvl, instr(lvl,slashes) + (len(slashes)-1) )

end sub


sub typeChanged()
 select case document.getElementById("cboType").value
  case 1
  case 2
  case 3
 end select
end sub
function fileExtension(fleNme)
 while right(fleNme,1)<>"."
  s=right(fleNme,1) & s
  fleNme=left(fleNme,len(fleNme)-1)
 wend
 fileExtension="." & s

end function
</script>
</head>
<body>
 
<table>
  <tr><td>
   <table id=tblFilters>
    <tr style='background-color:steelblue;color:white;'>
     <td width='1%' nowrap>Source Folder</td>
     <td colspan=6><input type=text class=inTbl id=txtSourceFolder /></td>
     <td width='1%' nowrap>Include Subfolders<input type=checkbox id=chkIncludeSubfolders /></td>
     <td rowspan=2 width='1%'><input type=button class=btn onclick=View() value=VIEW /><br><input type=button class=btn onclick=update() value=Update /></td>
    </tr> 
    <tr style='background-color:steelblue;color:white;'>
     <td width='1%' nowrap><select id=cboType onchange=typeChanged()><option value=1>Add To Front</option><option value=2>Add To End</option><option value=3>Replace Text</option></td>
     <td width='1%' align=right nowrap>Text To Replace</td><td colspan=3><input type=text class=inTbl id=txtReplaceText /></td>
     <td width='1%' align=right nowrap>Text To Add</td><td><input type=text class=inTbl id=txtAddText /></td>
     <td width='1%' nowrap></td>
    </tr>    
   </table> 

  <tr><td height='98%'>
 
  <table >
    <tr style='background-color:steelblue;color:white;height:1%;text-align:center;'>
     <td width='1%' nowrap>File Name</td>    
     <td width='30%' nowrap>Updated To</td>
     <!--td width='1%' nowrap>Folder</td-->     
    </tr>
    <tr>
     <td id=tdFiles width='50%' nowrap></td>    
     <td id=tdResults width='50%' nowrap></td>
     <!--td id=tdFolder width='1%' nowrap></td-->     
    </tr>   
   </table>

  </td></tr>   
 </table>  

</body>
</html>



i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Edited
6 Years Ago by Delerna
Delerna
Delerna
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
Upcomming doco

i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit



Reading This Topic