it’s drving me crazy, but better calm down and search for help. Here is my problem:
I generated a droplet with XCode (V2.2 on Tiger) and add some resources (XSL, PHP, Javascript files). No I’m trying to reference them from within my Applescript code via the “path to resource” command (exactly as discribed by Matt Neuburg in his “Applescript” book and as discribed in so many forum posts (add the resource via “Add to Project…” and then use "path to resource “myFileName”.
In my case this doesn’t compile. I always get the error message “resource not found”. And it doesn’t make any difference if I try to reference one of the added resources or one the resources inside the resources-folder after starting with the droplet like “InfoPlist.strings”. And also there is no diference if I’m working on a Droplet or an Application. I also tried to read about the Build-settings, but gave up.
At the moment I use absolute paths, but this is a bad solution if you want to give the droplet to other people.
Somebody got an idea, what in my context could be the reason for this behaviour?
it would also work with ‘property’ - but it also has to be declared outside and set inside of a handler:
property scriptFilePageNumbers : missing value
on awake from nib theObject
set scriptFilePageNumbers to path to resource "HR_PageNumbers.jsx"
end awake from nib
So it seams my memory has a leak
Perhaps I tried it like that:
property scriptFilePageNumbersName : "HR_PageNumbers.jsx"
on awake from nib theObject
set scriptFilePageNumbers to path to resource scriptFilePageNumbersName
end awake from nib
The aim was to declare all variables with information from outside at the beginning of my script.
But it doesn’t work like this, you actually have to give the “path to resource” command a String and not a variable declared as a property?