Processing - Change default application icon - processing

How to change the default icon of my Processing appIconTest.exe exported
application in windows ?
The default one :

After some research, the easiest solution i could find is :
Go into ...\processing-3.0.1-windows64\processing-3.0.1\modes\java\application
Save sketch.ico somewhere you can find (renaming it will help).
Place the icon you want to use in the same folder with the same name sketch.ico (which you might create using GIMP).
Now you can export your application from Processing.
Important : Be sure to save the default icon, because every application you export (after changing the icon) using Processing, will have this new icon.

You can change the icon of your running application (the icon that shows up in the title bar of the window and the task bar), but I don't think that's what you're asking about. You can't easily change the icon of the file itself.
That icon seems to be coming from the core.jar Processing library file, so if you want to hack at it, you could try replacing that file in the jar. I really don't recommend that though.
Because the .exe file that Processing exports isn't really an executable anyway- it's really just a shell that calls the code in the lib directory. (source)
If you want to create a real .exe file and have control over its icon, you should look into using a .exe generator like JSmooth or launch4j or JWrapper.

I would recommend Resource Hacker to change the icon of your programs.
Install Resource Hacker (latest build).
Go to your executable file.
Open it with Resource Hacker (right mouseclick, and there should be an option to do that or else you could just click open with).
It will open and show some directories, also one called "Icon", open that one, and right click one one of the icon files (stars with some numbers after that), there will be an option: "replace icon ... Ctrl + R", click that one and replace your icon.

Related

How can I save custom icons for shortcuts

I have a shortcut with a custom icon on it, the icon shows fine until I try copy the shortcut to another machine.
I have the icon saved in the same folder as the shortcut yet it still does not show when copied to another machine.
I was wondering if there was a way to have this icon stored inside the shortcut or some way to have it get the icon from the current folder with a relative path?
Icons cannot be stored inside a .lnk file and you cannot use a relative path to the icon.
The only thing you can use are environment variables (the .lnk will have a EXP_SZ_ICON_SIG data block).

How to change a file's extension to something else?

I downloaded an .R file from a zoom chat on desktop to open in Rstudio later.
Well, the .R extension was not part of the name, so I changed the name to something.pdf (of course by mistake).
The icon now looks like a pdf. I replaced the .pdf with .R. But the icon still is a PDF file and Rstudio does not recognize it as an R file.
How can I can change it back to its .R format?
edit. thanks for pointing this out. I am on a windows 10 machine. and the file is on desktop.
Troubleshoot for Windows
You may be trying to add multiple file extensions, which does not allow the file to be ready correctly.
A quick google search.
How do I reveal file extensions?
For Windows 8-10
Start Windows Explorer, you can do this by opening up any folder.
Click the View menu.
Check the box next to "File name Extensions"
Then make sure you have my_file.R as opposed to my_file.R.R.pdf.

Copy file full path in Xcode

I'm using Perforce for managing our code base. In Perforce, we need to check out a file before we can edit it. When I'm working in Xcode, sometimes I want to know the full path to the working file so that I can check it out in Perforce.
So here is my question:
Is there a shortcut, plugin or some other quick way to copy the full path of a file in Xcode?
What I have known:
I can Command+click on the file tile to show up the full path, but I cannot copy it.
In Visual Studio, we can right click on the file's tab and choose Copy Full Path to achieve this.
In Eclipse, we can Alt/Option + Enter to achieve this.
Update:
Actually my question is about how to achieve the equivalent Copy Full Path feature inside Xcode. Anyway, dragging the file to the terminal is also a very nice workaround.
You can copy it directly out of the File Inspector. The first section ("Identity and Type") of the File Inspector shows information about the selected file, or the file that contains the selected symbol, etc. You have Name, Type, Location, and Full Path. You can select the full path and copy it.
As a shortcut, a triple click on any part of the path will select the entire path. There's also a small icon with a light arrow on a dark background -- clicking that will open a Finder window with the file selected.
You can drag it to a terminal... Easy and fast...
on your editor XCode (you want to get the file path). Press:
Command+Shift+J
xcode will open directory file path on Project Navigator (left side bar)
and then drag-and-drop file from Project Navigator to the terminal. it will give you the directory of the file.
You can use find command to copy file path:
cd myProject
find . -name myCodeFile.cpp
Extending Caleb's answer, here is a graphical demo:
Steps:
Select a filename on the Project navigator from the left side Navigator panel.
Tap on Show File Inspector from the right side Inspectors panel. (marked with red box)
Copy the path from there. (marked with a bigger red box)

Visual Studio icon looks bad

I'm having trouble with my application icon looking bad after adding it into my project, building it, and creating a shortcut to it.
Here's what I've done:
1) I started with a 256x256 PNG file that looks great.
2) I used IcoFX to generate a .ICO file with all the recommended sizes.
3) I add the icon to my project as follows:
A) Open project properties -> Resources -> Add Resource -> Add Existing File
B) Choose the .ICO file that I created in step 2.
4) Go to "Application" section of project properties.
5) In "Icon and Manifest", drop down "Icon" and choose the icon that I added in step 3.
6) Save my project and build it.
7) Go to Windows Explorer and find the newly built EXE.
8) Create a shortcut to the EXE on the desktop.
The icon looks like this:
As you can see, it doesn't look very good. The edges are jagged, etc.
At first, I thought it was an issue with my .ICO file, but here's the kicker... I then did the following:
9) Right-click on the desktop icon, and go to Properties.
10) Go to the Shortcut tab and click "Change Icon".
11) Click "Browse", and select the EXACT SAME ICON FILE that I added to my project in step 3.
Now, my desktop icon looks like this:
Now, the icon looks pretty and smooth!
Again, both icons used the exact same source .ICO file. The only difference is that the first one was imported into Visual Studio and embedded in my .EXE, and the other one was directly used via the OS.
What is Visual Studio doing to my icon to make it look so crummy, and how can I prevent it?
This could be a problem with the windows icon cache. I had the same problem that I fixed by clearing the cache.
The first version of your code that you copied to the desktop - did this have a low res icon ?
Windows will cache the icon when it first sees the EXE, and then does not refresh even when you rebuild your executable if it has the same filename. You will also see the same behavior in windows explorer.
I think by changing the icon through the OS, you've just manually refreshed the icon cache.
You can quickly test this by renaming the EXE before copying it to the desktop. This will bypass the cache and show the actual icon in your EXE.
To get rid of any old icons in the icon cache, you can clear it as described in this link
http://www.winability.com/how-to-erase-icon-thumbnail-cache-windows-8/

How to load scripts from a custom folder in InDesign? like from a central repository

I would need a folder to be shared on the server and InDesign CS6 would need to load the scripts from that particular location.
Is this possible?
If you just want to include other scripts in your script you can do this:
$.evalFile(new File(mainscriptloc + "/c/some/folder/central.jsx"));
It will load central.jsx into the executing script just like an "include" file.
On a Mac? I found this solution useful:
http://tewha.net/2012/07/make-a-symbolic-link-from-finder/
The best way I found is to create a folder in any place you want your scripts to be (like a server) which is shared with all the users. Then to setup and run the scripts will be more tricky:
Open ExtendScript Toolkit
Open "Scripts" tab
Click on the top-right button and "Add Favorite"
Choose your path to the script and click ok
Now you can click on the drop down on the left and select "Favorites"
Click on the right drop down and click on your folder name
Double click on your script and run it
Now you are running scripts directly from the custom folder.
The startup script cannot be run from there... so it only works with scripts.
We create links in the users individual scripts folders that link back to the actual script in the central repository on Windows. The downside is of course that users will reasonable often accidentally copy the actual script, rather than a link to the script - and then they miss out on future updates to the script.
Below is an example of a typical users 'scripts panel' folder. Each of the shown shortcuts point at a file in our central repository.
When the user opens InDesign these shortcuts appear in their scripts panel the same way a regular script file would.
On a Mac, I suggest using symlinks (a special kind of OSX shortcut - go here for instructions and an Automator workflow download that will create one whenever you need it).
To create a shortcut, simply select the desired folder (recommended) or file located elsewhere on your computer/server and run the workflow (I suggest making a keyboard shortcut to the workflow as described in the instructions). Drag the shortcut created into your inDesign scripts folder and it will appear and operate exactly as the actual script or folder would in your Scripts Panel. Simply click on the link and inDesign will do the rest - you'll never know what you clicked is not the actual folder/file or that it's located elsewhere.
Note: if you create a shortcut to a script file rather than a folder, be sure to remove the extra text the workflow adds to the name (ie. when applied to "MyScript.jsx", the workflow will create a shortcut named "MyScript.jsx symlink". Remove the " symlink" part so inDesign will recognize the shortcut as a script file. Otherwise it will not run).
I've tested this with inDesign CC on my Mac and it works flawlessly.

Resources