File...wasn´t found (-43)

Hi,
I use Xcode for Applescript the first time. I have pasted the code, which works fine in the Apple script editor, into xcode (3.2) and ran it, but it states the mentioned message: File…wasn´t found (-43)

set sc_folder to ":Library:Application Support:Native Instruments:Service Center" as alias

Thankful for any hints,
Andreas

Hi,

a common mistake: HFS paths start always with a disk name,
a leading colon is never a replacement for the startup volume like a leading slash in POSIX paths.

It’s not necessary to specify the startup volume, just use a relative path


set sc_folder to (path to application support folder as text) & "Native Instruments:Service Center" as alias

Fast & Furious as always. It´s working fine in the AppleScript Editor though.

Big help, thank you Stefan!

To fast :confused:

It unfortunately still doesnt work. I have tried this:

set sc_folder to ((path to startup disk) as Unicode text) & ":Library:Application Support:Native Instruments:Service Center" as alias

Again it works fine in AppleScript Editor, but not in xcode.

This one doesn´t work also:

display dialog "Enter admin password:" default answer "" with hidden answer
	set admin_pass to text returned of result

Xcode spits out a fatal error, but it doesn´t give me an exact error or something like the events and results in the Editor. It´s the second line coursing the trouble. I had to find this out by trial and error.

The only reason for me to use xcode is a progress bar. I also like the used admin pass prompt with the inclided icons…

Do you have a hint for general xcode vs. editor issues to port code from the editor?

best,
a.

why not path to application support folder ?

Xcode has its own display dialog version without hidden answer parameter, it’s described in the documentation. Use a secure text field instead

Because the script uses other pathes on the root directory later on, so I need to find a way to target those.

This should work


set sc_folder to (path to startup disk as Unicode text) & "Library:Application Support:Native Instruments:Service Center" as alias

btw: it’s not recommended to write user data into the root directory.

Can´t make it. Always states:

I wonder it states “file”, as it is a folder. Might be a hint?!

I know, I don´t write anything. I have to read out a lot of plist files and list and analyse other existing directories. It´s a diagnostic tool I´m scripting. It´s already working fine in the editor, only: there is no progress bar and it takes pretty long, so I need one too keep users calm…

a folder string path should have a colon at the end.
Is the line in any tell block which contains AppleScript Studio terminology?

If yes, put it out. Scripting Additions and Studio terminology sometimes clash in the same tell block

No. The only AppleScript Studio part I use is a window with a progress spinner.

This all looks very complicated. Maybe I try to start the actual program (made with the editor) from another studio made programm with a progress bar.

Thank you for your suggestions Stefan.

to let it work in script editor and xcode the most shortest answer to get the name of boot volume is

POSIX file "/" as string

EDIT:

then you don’t need to start the appending string with a “:”.

Thi one worked. Thanx.