Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 6, 2013, 04:50 PM   #1
Link1010
macrumors newbie
 
Join Date: Jun 2012
Location: Ontario, Canada
Applescript Application icon won't change

Okay, so I just got Front row back on my macbook pro, but in order to activate it i needed to make an applescript. The script works fine and will activate front Row, but when I save my script as an application it wont let me change the icon of it. every time I try to replace the icns file with my own (yes changed the name to match of my icns file to match the previous one) all that it shows is the preview applications icon with the letters icns below it.

I have also tried to change it by copy and pasting it using finder.

Can someone please help me? I dont know what to try

P.S. If you want I can upload my file to dropbox so you can try and change it yourself.
__________________
|\13" Macbook Pro (late 2011, 2.4 GHz, 16gb RAM, Crucial M500 960gb SSD, Mavericks)/|
|\
iPhone 5s (Space Grey, 64gb)/|\iPod touch (2nd and 4th gen)/|\Apple TV (2nd gen.)/|
Link1010 is offline   0 Reply With Quote
Old Jun 6, 2013, 05:06 PM   #2
kryten2
macrumors 6502a
 
Join Date: Mar 2012
Location: Belgium
Quote:
Originally Posted by Link1010 View Post
Okay, so I just got Front row back on my macbook pro, but in order to activate it i needed to make an applescript. The script works fine and will activate front Row, but when I save my script as an application it wont let me change the icon of it. every time I try to replace the icns file with my own (yes changed the name to match of my icns file to match the previous one) all that it shows is the preview applications icon with the letters icns below it.

I have also tried to change it by copy and pasting it using finder.

Can someone please help me? I dont know what to try

P.S. If you want I can upload my file to dropbox so you can try and change it yourself.
Does the icns file show when you preview it in the Finder? Or does it also show with the letters icns below it? Could be a wonky icns file. Please attach it to your post and the application as well.
__________________
Space Corps Directive 34124
kryten2 is offline   0 Reply With Quote
Old Jun 6, 2013, 07:04 PM   #3
Link1010
Thread Starter
macrumors newbie
 
Join Date: Jun 2012
Location: Ontario, Canada
Quote:
Originally Posted by kryten2 View Post
Does the icns file show when you preview it in the Finder? Or does it also show with the letters icns below it? Could be a wonky icns file. Please attach it to your post and the application as well.
I'm currently changing up my script a bit, so I'll upload it soon, but for now here is the icon (it wont let me attach it because it is in the icns format)

https://www.dropbox.com/s/zh0nzl4tg04kuw3/applet.icns
__________________
|\13" Macbook Pro (late 2011, 2.4 GHz, 16gb RAM, Crucial M500 960gb SSD, Mavericks)/|
|\
iPhone 5s (Space Grey, 64gb)/|\iPod touch (2nd and 4th gen)/|\Apple TV (2nd gen.)/|
Link1010 is offline   0 Reply With Quote
Old Jun 6, 2013, 07:35 PM   #4
Link1010
Thread Starter
macrumors newbie
 
Join Date: Jun 2012
Location: Ontario, Canada
Quote:
Originally Posted by kryten2 View Post
Does the icns file show when you preview it in the Finder? Or does it also show with the letters icns below it? Could be a wonky icns file. Please attach it to your post and the application as well.
Yes i can see the icon when i quick view it. Here is the application.
**NOTE: it will probably not work or do anything for you unless you have front row installed** (or it might not work period cause im not that good with applescript yet)

https://www.dropbox.com/sh/ccasvifc0j14n5m/J__BevW2Wh
__________________
|\13" Macbook Pro (late 2011, 2.4 GHz, 16gb RAM, Crucial M500 960gb SSD, Mavericks)/|
|\
iPhone 5s (Space Grey, 64gb)/|\iPod touch (2nd and 4th gen)/|\Apple TV (2nd gen.)/|
Link1010 is offline   0 Reply With Quote
Old Jun 6, 2013, 08:01 PM   #5
kryten2
macrumors 6502a
 
Join Date: Mar 2012
Location: Belgium
Copy and pasting the original Front Row icon using the Finder works for me.
Changing the applet.icns file in the Resources folder of the application with the one from the Resources folder of Front Row (eg frontrow.icns) also works.
The third attached thumbnail is your applet.icns file. Something wrong there. It's missing the 256 x 256 and 512 x 512 pixels images. Try the one in the attached zip file.

Note : By application I mean something I made not yours.

Edit : I downloaded your application and it shows the Front Row icon just fine.128 x 128 pixels that is.
Attached Thumbnails
Click image for larger version

Name:	Picture 3.png
Views:	63
Size:	101.0 KB
ID:	415615   Click image for larger version

Name:	Picture 4.png
Views:	62
Size:	107.6 KB
ID:	415616   Click image for larger version

Name:	Picture 5.png
Views:	62
Size:	135.5 KB
ID:	415617  

Click image for larger version

Name:	Picture 6.png
Views:	102
Size:	122.2 KB
ID:	415618  
Attached Files
File Type: zip applet.icns.zip (297.7 KB, 59 views)
__________________
Space Corps Directive 34124

Last edited by kryten2; Jun 6, 2013 at 08:31 PM.
kryten2 is offline   0 Reply With Quote
Old Jun 6, 2013, 11:04 PM   #6
Link1010
Thread Starter
macrumors newbie
 
Join Date: Jun 2012
Location: Ontario, Canada
Quote:
Originally Posted by kryten2 View Post
Copy and pasting the original Front Row icon using the Finder works for me.
Changing the applet.icns file in the Resources folder of the application with the one from the Resources folder of Front Row (eg frontrow.icns) also works.
The third attached thumbnail is your applet.icns file. Something wrong there. It's missing the 256 x 256 and 512 x 512 pixels images. Try the one in the attached zip file.

Note : By application I mean something I made not yours.

Edit : I downloaded your application and it shows the Front Row icon just fine.128 x 128 pixels that is.
Okay so, I copied you icon into the resources folder and nothing happened, I also tried doing the finder way and then restarted my mac to see if it would change then, but of course again, nothing changed unfortunately . But when I started spamming the paste button, the icon appeared for a couple seconds and then went away. Check out my screen recording, it'll show you what happens.

BTW thanks for all your help so far!
Attached Files
File Type: zip Icon Glitch.mp4.zip (1.55 MB, 36 views)
__________________
|\13" Macbook Pro (late 2011, 2.4 GHz, 16gb RAM, Crucial M500 960gb SSD, Mavericks)/|
|\
iPhone 5s (Space Grey, 64gb)/|\iPod touch (2nd and 4th gen)/|\Apple TV (2nd gen.)/|
Link1010 is offline   0 Reply With Quote
Old Jun 9, 2013, 03:39 PM   #7
kryten2
macrumors 6502a
 
Join Date: Mar 2012
Location: Belgium
Really don't know what's causing this. Could be corrupted caches or quicklook acting strange. You'll have to look up how to clear caches or fix quicklook.
One last thing you can try is to use SetFileIcon.
__________________
Space Corps Directive 34124
kryten2 is offline   0 Reply With Quote
Old Jun 11, 2014, 03:33 PM   #8
Asanga
macrumors newbie
 
Join Date: Jun 2014
Location: Bremen, Germany
Quote:
Originally Posted by kryten2 View Post
Really don't know what's causing this. Could be corrupted caches or quicklook acting strange. You'll have to look up how to clear caches or fix quicklook.
One last thing you can try is to use SetFileIcon.
This may be already solved for the OP. Since the solution was not written, I thought of writing what I found when I tried to do the same (i.e., change the icon of the Apple Script based app).

I copied a new icon file (applet.icns) and even though the file was there, it did not appear in the Finder beside the app. After some unsuccessful experiments, I found that in the .app directory, in addition to the Contents directory there was a hidden file starting with the name “Icon?”. This was only visible once I opened a terminal and ran a “ls -la”. I removed this file and voila!, the icon appeared beside the app.

I have no idea how that file got there. Maybe it was my experimenting.

Hope this will help others who may have the same issue.

Best regards,

Asanga

An update:

Feels extremely silly to explain this, but this is how I changed the icon.

- select app in Finder and open app directory through “Show Package Contents”
- go to Contents/Resources and copy/paste the new icon (.icns file) onto applet.icns
- select the app, again in Finder and this time, click on “Get Info”
- select the app icon at the top - a blue outline will appear
- copy the icon (.icns file) onto this outlined icon (command-v)
- now, check the .app directory using a terminal - “ls -la”
- the “Icon?” file should be there
- delete this file - “rm Icon^M”
- immediately, the app should have the copied icon beside it in the Finder

BTW, I have OS X 10.9.3 (13D65)

Last edited by Asanga; Jun 11, 2014 at 04:24 PM.
Asanga is offline   1 Reply With Quote
Old Jun 11, 2014, 11:58 PM   #9
zeppenwolf
macrumors member
 
Join Date: Nov 2009
Quote:
...in addition to the Contents directory there was a hidden file starting with the name “Icon?”
Actually, that's not quite exactly the name of the file. That's how UNIX represents a file whose name is "Icon
".

The reason it's called "Icon
" is so that it's utterly impossible for the user to type the same name while in the Finder. Get it? Once you hit the Return key, you've got the name "Icon", so you can never actually type "Icon
".

Are you using Mavericks ? Well, one thing hasn't changed from 1984 until Snow Leopard, which I'm using now as I type, (long story), but I won't be surprised if it's still the same on Mavericks, (whatever the heck a Maverick is???)

Select and Copy a graphic; select a folder, Get Info, and Paste the Copied graphic onto the default folder icon... It works, of course-- the folder now has your custom graphic. What hasn't changed is the way it is implemented: a hidden file is created in the folder with the name "Icon
", and it has a resource fork, with one single resource of type "ICNS", or "icns", (I can't remember), and resource ID -16455.

It might sound strange now, but there was a time when it seemed like ResEdit was the coolest program ever written...
__________________
Maximum 200 characters and 4 lines.
No blank lines or lines of punctuation characters!
May not be distracting, oversized, or in conflict with any forum rules.
Please use continuous text rather t...
zeppenwolf is offline   1 Reply With Quote
Old Jun 12, 2014, 04:48 AM   #10
Asanga
macrumors newbie
 
Join Date: Jun 2014
Location: Bremen, Germany
Quote:
Originally Posted by zeppenwolf View Post
Are you using Mavericks ?
Yes.

Quote:
Originally Posted by zeppenwolf View Post
Select and Copy a graphic; select a folder, Get Info, and Paste the Copied graphic onto the default folder icon... It works, of course-- the folder now has your custom graphic. What hasn't changed is the way it is implemented: a hidden file is created in the folder with the name "Icon
", and it has a resource fork, with one single resource of type "ICNS", or "icns", (I can't remember), and resource ID -16455.
I tried this and saw the “Icon?” file as you mentioned. But, the folder lost the folder icon and shows some other icon, not the one I copied. When I deleted the “Icon?” file, it reverted back to the original folder icon.
Asanga is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Tags
applescript, icon, macbook pro

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Any way/application to click on application icon in dock and minimize? TheArgonaut OS X Mavericks (10.9) 3 Dec 6, 2013 09:23 PM
iPhone: ipod icon won't change...back... fisherking Jailbreaks and iOS Hacks 4 Mar 3, 2013 06:19 PM
iPhone: Maps icon won't change cclloyd Jailbreaks and iOS Hacks 5 Feb 8, 2013 05:21 PM
AppleScript Application MacGeekJunior Mac Programming 2 Sep 2, 2012 03:12 PM
EasyMeasure Icon won't change cclloyd Jailbreaks and iOS Hacks 2 Jun 14, 2012 11:25 AM

Forum Jump

All times are GMT -5. The time now is 07:55 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC