osx snow leopard - Why does Applescript run in Script Editor, but error when saved as Application? -
My applescript needs to detect its own file, and runs fine on the following Snow Leopard (10.6) < / P>
Set my_name to my name as string display dialog "name:" & amp; My_name
Displays this "Name: AppleScript Editor" when I run it from AppleScript Editor, and it displays "Name: NewTest" when I call it NewTest as an app I save.
When I run it on a Leopte (10.5) machine, it complains it can not make a name in the "Type string". When I remove the "string" portion, it goes under the script editor, returning "name: script editor", but when saved as an app, these errors occur and say " The name can not be obtained. "
What's different about running the script editor and saving it as an app under 10.5?
There is another idea here, though I have not investigated. One thing that can cause problems is "mill" generally when you get commands like "command mill" you run a command, then you are actually running "give me name" The problem is that the implied " Meet "is not always the case, sometimes you say" meet "clearly, whenever I am your biggest problem as I try to add" to get the command "... this habit becomes Because you are Do not know now that you can always use the word and you can never get that problem. For example, to change your order, try "Set my name" (get my name). I would be interested to know whether your 10.5 problem is okay also keep in mind that a name is already a string, so there is no need to force the result to string.
Edit: I saw through some of my old scripts I used the following code to get the name. In my notes I have these comments ...
- This will get the name of the application or script without any file extension
- This is done using the path because when A script runs from the script menu, and you set my name to my name, then the result is "applescript runner" instead of the real name
- It also assures that you get the form of the name In this it appears in the finder because -Every system event varies with name name Finder name
get myname on myMax () myPath sets my text as path if myPath ends with ":" set up To set from n to -2 and from n to -1 to set AppleScript's text item delimiter to "::" set myName to myPath's text item n if (in "myName" is "."), Then AppleScript's text item delimiter should be set to myName for text from TextName of "MyName End" if A PpleScript's text item delimiter myName end getMyName
Comments
Post a Comment