AppleScript-Studio Archive

List Statistics

  • Total Threads: 13
  • Total Posts: 22
  #1  
10-07-2010 09:08 AM
AppleScript-Studio member admin is online now
User
 

G'day all

This has driven me bonkers. I've spent all afternoon trying to convert the path into the resource folder on an application, and all I get is an error message, 'Can't make ≪class ocid≫ id ≪data kptr40452101≫ into type string'.

I'm trying to put a password into the resource folder in the App. made with ApplescriptObjC.

The part of the script is

on SecurePasswordEntry_(sender)
set ThePassword to SecurePassword's stringValue() as text
if ThePassword ≠ "" then
set ptsf to current application's NSBundle's mainBundle()'s resourcePath() as text
display dialog ptsf
set pathToFile to POSIX file ptsf -- error occurs here
try
display dialog pathToFile
on error errmsg
display dialog errmsg
end try
set tester to false
try

Any help appreciated, thanks.

Regards

Santa


And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo

  #2  
10-07-2010 09:33 AM
AppleScript-Studio member admin is online now
User
 

G'day all

This has driven me bonkers. I've spent all afternoon trying to convert the path into the resource folder on an application, and all I get is an error message, 'Can't make ≪class ocid≫ id ≪data kptr40452101≫ into type string'.

I'm trying to put a password into the resource folder in the App. made with ApplescriptObjC.

The part of the script is

on SecurePasswordEntry_(sender)
set ThePassword to SecurePassword's stringValue() as text
if ThePassword ≠ "" then
set ptsf to current application's NSBundle's mainBundle()'s resourcePath() as text
display dialog ptsf
set pathToFile to POSIX file ptsf -- error occurs here
try
display dialog pathToFile
on error errmsg
display dialog errmsg
end try
set tester to false
try

Any help appreciated, thanks.

Regards

Santa


And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo On 10/07/2010, at 6:16 PM, Mark Schonewille wrote:

> Hi,
>
> Use
>
> set myPath to POSIX path of myPath
>
> to create a unix path and
>
> set myFile to POSIX file myPath as alias
>
> to create an AS path.
>
> --
> Best regards,
>
> Mark Schonewille
>

Thanks Mark, but adding 'as alias' only froze the script completely. Even ensuring the path was a true unix path made no difference.

I tried t his, with the same error message....

on SecurePasswordEntry_(sender)
set ThePassword to SecurePassword's stringValue() as text
if ThePassword ≠ "" then
set ptsf to current application's NSBundle's mainBundle()'s resourcePath() as text
set tempPath to POSIX path of ptsf
display dialog tempPath
say 4
set pathToFile to POSIX file tempPath
try
say 3
display dialog pathToFile
on error errmsg
display dialog errmsg
end try



And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo

  #3  
10-07-2010 12:55 PM
AppleScript-Studio member admin is online now
User
 

G'day all

This has driven me bonkers. I've spent all afternoon trying to convert the path into the resource folder on an application, and all I get is an error message, 'Can't make ≪class ocid≫ id ≪data kptr40452101≫ into type string'.

I'm trying to put a password into the resource folder in the App. made with ApplescriptObjC.

The part of the script is

on SecurePasswordEntry_(sender)
set ThePassword to SecurePassword's stringValue() as text
if ThePassword ≠ "" then
set ptsf to current application's NSBundle's mainBundle()'s resourcePath() as text
display dialog ptsf
set pathToFile to POSIX file ptsf -- error occurs here
try
display dialog pathToFile
on error errmsg
display dialog errmsg
end try
set tester to false
try

Any help appreciated, thanks.

Regards

Santa


And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo On 10/07/2010, at 6:16 PM, Mark Schonewille wrote:

> Hi,
>
> Use
>
> set myPath to POSIX path of myPath
>
> to create a unix path and
>
> set myFile to POSIX file myPath as alias
>
> to create an AS path.
>
> --
> Best regards,
>
> Mark Schonewille
>

Thanks Mark, but adding 'as alias' only froze the script completely. Even ensuring the path was a true unix path made no difference.

I tried t his, with the same error message....

on SecurePasswordEntry_(sender)
set ThePassword to SecurePassword's stringValue() as text
if ThePassword ≠ "" then
set ptsf to current application's NSBundle's mainBundle()'s resourcePath() as text
set tempPath to POSIX path of ptsf
display dialog tempPath
say 4
set pathToFile to POSIX file tempPath
try
say 3
display dialog pathToFile
on error errmsg
display dialog errmsg
end try



And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo For some reason can't use "POSIX file" in a specifier -- you have to coerce:

set hfsPath to (((POSIXPath as text) as POSIX file) as text)


--



_______________________________________________
___________________________________________________

Posted on the AppleScript-Studio mailing list. Go to http://lists.apple.com/mailman/listinfo/applescript-studio to subscribe.

  #4  
11-07-2010 05:48 AM
AppleScript-Studio member admin is online now
User
 

G'day all

This has driven me bonkers. I've spent all afternoon trying to convert the path into the resource folder on an application, and all I get is an error message, 'Can't make ≪class ocid≫ id ≪data kptr40452101≫ into type string'.

I'm trying to put a password into the resource folder in the App. made with ApplescriptObjC.

The part of the script is

on SecurePasswordEntry_(sender)
set ThePassword to SecurePassword's stringValue() as text
if ThePassword ≠ "" then
set ptsf to current application's NSBundle's mainBundle()'s resourcePath() as text
display dialog ptsf
set pathToFile to POSIX file ptsf -- error occurs here
try
display dialog pathToFile
on error errmsg
display dialog errmsg
end try
set tester to false
try

Any help appreciated, thanks.

Regards

Santa


And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo On 10/07/2010, at 6:16 PM, Mark Schonewille wrote:

> Hi,
>
> Use
>
> set myPath to POSIX path of myPath
>
> to create a unix path and
>
> set myFile to POSIX file myPath as alias
>
> to create an AS path.
>
> --
> Best regards,
>
> Mark Schonewille
>

Thanks Mark, but adding 'as alias' only froze the script completely. Even ensuring the path was a true unix path made no difference.

I tried t his, with the same error message....

on SecurePasswordEntry_(sender)
set ThePassword to SecurePassword's stringValue() as text
if ThePassword ≠ "" then
set ptsf to current application's NSBundle's mainBundle()'s resourcePath() as text
set tempPath to POSIX path of ptsf
display dialog tempPath
say 4
set pathToFile to POSIX file tempPath
try
say 3
display dialog pathToFile
on error errmsg
display dialog errmsg
end try



And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo For some reason can't use "POSIX file" in a specifier -- you have to coerce:

set hfsPath to (((POSIXPath as text) as POSIX file) as text)


--



_______________________________________________
___________________________________________________

Posted on the AppleScript-Studio mailing list. Go to http://lists.apple.com/mailman/listinfo/applescript-studio to subscribe. Thanks again Shane.

I never would have worked that out.

Regards

Santa

On 10/07/2010, at 9:55 PM, Shane Stanley wrote:

> For some reason can't use "POSIX file" in a specifier -- you have to coerce:
>
> set hfsPath to (((POSIXPath as text) as POSIX file) as text)
>
>
> --
>
>
>
> _______________________________________________
___________________________________________________

Posted on the AppleScript-Studio mailing list. Go to http://lists.apple.com/mailman/listinfo/applescript-studio to subscribe.





NewsArc Lists  |  Culture Pages   |  Computing Archive  |  Media-Pages
Link to this page on your blog or website by copying the HTML code below and pasting it into your site: