• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[newbie] applescript in cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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


  • Follow-Ups:
    • Re: [newbie] applescript in cocoa
      • From: Damien Bobillot <email@hidden>
  • Prev by Date: Re: Running out of memory with Core Data
  • Next by Date: Re: Unable to set up Apple's PDFKitLinker2 example code: project can't "find" PDFKit.framework
  • Previous by thread: Re: Questions regarding WebView
  • Next by thread: Re: [newbie] applescript in cocoa
  • Index(es):
    • Date
    • Thread