-
1. Re: Possible to change folder icon using app.system()? [PC/mac]
Muppet Mark Aug 13, 2013 12:14 PM (in response to Pedro Marques)Im not sure you can do this… Im only speaking from the mac point of view… I have done this in the past with AppleScript.
There was no in-built apple shell to this and I needed to use a third party utility…
http://www.hamsoftengineering.com/codeSharing/SetFileIcon/SetFileIcon.html
http://osxutils.sourceforge.net/
It may also be possible using the apple developer tools if they are installed…
-
2. Re: Possible to change folder icon using app.system()? [PC/mac]
Pedro Marques Sep 2, 2013 6:11 AM (in response to Muppet Mark)I just have done this for Mac and it works.
I had to create an app from applescript that reads an xml with the 2 paths (the icon image path and the folder/file path to put the icon)
This app has also the shell command to add the icon.
Putting all the files on the right places, I just add to update the xml with the image new icon and the file/folder path and then call the app from the app.system that reads the file.
If the file to change the icon is from the Users directory, it works fine, If it is from the network I have to add /Volumes/ before its path.
-
3. Re: Possible to change folder icon using app.system()? [PC/mac]
Pedro Marques Jul 15, 2014 3:25 AM (in response to Muppet Mark)var f=new File(app.document.presentationPath + "/desktop.ini");
f.open('w');
f.encoding = "UTF8";
f.writeln("[.ShellClassInfo]");
// I have chosen one icon of windows7, but you can design and create your own icon, export it to .ico and add it here, for ex: f.writeln("IconResource=c:\\Users\\Public\\myIcons\\myicon.ico");
f.writeln("IconResource=%windir%\\system32\\imageres.dll,101"); // if using dll of windows, a 2nd argument is needed to set the number of the icon (there are several possible dll libraries with hundreds of icons)
f.writeln("[ViewState]");
f.writeln("Mode=");
f.writeln("Vid=");
f.writeln("FolderType=Pictures");
f.close();
.hidden=true;
//
var cmd = "attrib +s \"" + decodeURI(app.document.presentationPath) + "\"";
app.system(cmd);
// go to the parent folder to refresh and come back again:
var back = app.document.thumbnail.uri;
app.document.thumbnail = app.document.thumbnail.parent;
app.document.thumbnail.refresh();
app.document.thumbnail = new Thumbnail(back);


