Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DavidBlack

macrumors 6502a
Original poster
Jan 27, 2013
606
239
Somewhere In Apple's HQ ;)
Strange. It looks like there is no space between the & and "docs:doc" but it is not really clear. Try with another folder name or type the single set theFolder line in another script editor window and see if it compiles.

Code:
set exePath to (path to home folder as text) & "SetFileIcon"
set imagePath to (path to desktop folder as text) & "Actions.icns"
set theFolder to (path to desktop folder as text) & "docs:doc"

Just one more question I won't bother you again I want the action.icns and the setFileIcon to be in a applications resources but when I place the path it does it work .
 

Attachments

  • Screen Shot 2013-03-15 at 3.50.53 PM.png
    Screen Shot 2013-03-15 at 3.50.53 PM.png
    1.4 MB · Views: 135

kryten2

macrumors 65816
Mar 17, 2012
1,114
99
Belgium
Just one more question I won't bother you again I want the action.icns and the setFileIcon to be in a applications resources but when I place the path it does it work .

Yes.

Code:
set exePath to path to resource "SetFileIcon"
set imagePath to path to resource "Actions.icns"
 

Attachments

  • Picture 3.png
    Picture 3.png
    72.2 KB · Views: 82
  • Picture 4.png
    Picture 4.png
    85.6 KB · Views: 81

DavidBlack

macrumors 6502a
Original poster
Jan 27, 2013
606
239
Somewhere In Apple's HQ ;)
Yes.

Code:
set exePath to path to resource "SetFileIcon"
set imagePath to path to resource "Actions.icns"

YES thanks for your reply but this looks like it applies when making application with applescript editor.I am adding the setIconFile and icon file to my xcode project then when I click a button it would execute the applescript

NSString* path = [[NSBundle mainBundle] pathForResource:mad:"icons change" ofType:mad:"scpt"];
NSURL* url = [NSURL fileURLWithPath:path];NSDictionary* errors = [NSDictionary dictionary];
NSAppleScript* appleScript = [[NSAppleScript alloc] initWithContentsOfURL:url error:&errors];
[appleScript executeAndReturnError:nil];

Thats the code in Xcode can you help me?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.