[newbie] applescript in cocoa
[newbie] applescript in cocoa
- Subject: [newbie] applescript in cocoa
- From: Francesca P <email@hidden>
- Date: Mon, 25 Jul 2005 15:50:01 +0200
Hello,
I'm newbie,
I'm trying to run an applescript from a cocoa application.
This is my code:
path = [[NSBundle mainBundle] bundlePath];
path1=[(path)stringByDeletingLastPathComponent];
scriptCartella=[NSString stringWithFormat: @"tell application
\"Finder\" \n set cartella to \"%@\" \n set cartella2 to path of
cartella \n set cartellapb to \"cartellaZ\" \n if not (exists folder
cartellapb of cartella2) then make new folder at cartella2 with
properties {name:cartellapb} \n end tell",path1];
scriptt=[[NSAppleScript alloc] initWithSource:scriptCartella];
[scriptt executeAndReturnError:nil];
[scriptt release];
I've a problem.
If I set the path manually the application works.
But using path1 it doen't work.
I think is a problem of path in applescript (slash, or : or Posix...I
don't know).
Someone can help me???
Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden