help with conversion of applescript into App

roboamg

Registered
Hi

I nedd to convert the following apple script into App. The apple script worksfine however after the conversion it does not work anymore. Any hint on how to fix this? This is the script:


--> Useful variables

set fileCheck to false

set languageCheck to false

set selectionCheck to false


set fileExtension to ""

set myCommand to ""


--> Get selected file

tell application "Finder"

if selection is {} then

tell application "Terminal"

activate

end tell

else

set finderSelection to selection as alias list

set selectionCheck to true

end if

end tell


--> Get file POSIX path

if selectionCheck is true then

set filePath to quoted form of POSIX path of finderSelection

set myCommand to "/Applications/AMIDE.app/Contents/MacOS/AMIDE-bin"

set languageCheck to true

do shell script "" & myCommand & " " & filePath

end if

AppleScript


Thanks
 
Can you be more specific? What part of it fails? Is there an error message?

I don't think this script will work if more than one file is selected, since you're accessing the POSIX path of finderSelection (that won't work on a list, only a single object). But maybe that's not important.
 
Can you be more specific? What part of it fails? Is there an error message?

I don't think this script will work if more than one file is selected, since you're accessing the POSIX path of finderSelection (that won't work on a list, only a single object). But maybe that's not important.


Thanks for the reply

The script is supposed to handle one file at a time. Then the application AMIDE is called. The script works fine when executed as script, when saved as application it does not do anything, no error message is shown, The app just does nothing. It seems to me I am missing something in the script to converte it into app, Is that rigth?

Thanks
 
You shouldn't need to change anything to get a script to work in app form, so it's strange. I just edited the script to use TextEdit instead of AMIDE (since I don't have it), and it works either as a script or as an app.

For the purposes of debugging, try inserting "display dialog" commands at different parts of the script so you can see what it's doing and (hopefully) where it's failing. For example, 'display dialog myCommand & " " & filePath' before the do shell script command.
 
Back
Top