Link command fails in mac-standalone
Posted: Mon Jan 14, 2013 3:35 pm
Hi
I have some options for users to produce link-buttons to folders, programs and files in their diary. These options works nicely also in standalones on windows, and in the prototype Mac version, but they fail in a funny way in Mac standalones, because I get an error message saying, that they do not find...and then specifies the full and exact address of the file they say they cannot find..
button ”Filetype”:
on mouseUp
if (there is a file (the cFile of me)) then
if the platform is "MacOS" then
put revmacfromunixpath(the cFile of me) into myFile
put "tell application 'Finder'" & return & "activate" & return & \
"open file'" & myFile & quote & return & "end tell" into myScript
replace "'" with quote in myScript
replace slash with colon in myScript
do myScript as AppleScript
else if the platform is "Win32" then
put "start '' '" & the cFile of me & quote into myShell
replace "'" with quote in myShell
get shell(myShell)
else beep
else if the cFile of me is empty then
beep
answer error "Sorry, no File has been set." with "Okay"
else
beep
answer error "Sorry, I can't find file" && the cFile of me
end if
....etc
The script of the link to program is slightly different:
on mouseUp
if (there is a file (the cFile of me) or there is a folder (the cFile of me)) then
put empty into rslt
if the platform is "MacOS" then
put revmacfromunixpath(the cFile of me) into myFile
put "tell application 'Finder'" & return & "activate" & return & \
"open file'" & myFile & quote & return & "end tell" into myScript
replace "'" with quote in myScript
replace slash with colon in myScript
do myScript as AppleScript
put the result into rslt
else if the platform is "Win32" then
put "start '' '" & the cFile of me & quote into myShell
replace "'" with quote in myShell
get shell(myShell)
put the result into rslt
else
beep
end if
if rslt is empty then
close stack "stormaske"
set the iconic of stack "phenomenalog" to true
else
beep
answer error "Sorry, an error occurred" with "OK"
end if
else if the cFile of me is empty then
beep
answer error "Sorry, no File has been set." with "Okay"
else
beep
answer error "Sorry, I can't find file" && the cFile of me
end if
ikonide
end MouseUp
I must admit that I don't understand what the reference to "result" and rslt means, perhaps an early attempt to repair the bug.
But as even the link to file doesn't function I would disregard it, until further.
Hope somebody have an idea how to repair
best regards
Kresten Bjerg (www.phenomenalog.dk)
I have some options for users to produce link-buttons to folders, programs and files in their diary. These options works nicely also in standalones on windows, and in the prototype Mac version, but they fail in a funny way in Mac standalones, because I get an error message saying, that they do not find...and then specifies the full and exact address of the file they say they cannot find..
button ”Filetype”:
on mouseUp
if (there is a file (the cFile of me)) then
if the platform is "MacOS" then
put revmacfromunixpath(the cFile of me) into myFile
put "tell application 'Finder'" & return & "activate" & return & \
"open file'" & myFile & quote & return & "end tell" into myScript
replace "'" with quote in myScript
replace slash with colon in myScript
do myScript as AppleScript
else if the platform is "Win32" then
put "start '' '" & the cFile of me & quote into myShell
replace "'" with quote in myShell
get shell(myShell)
else beep
else if the cFile of me is empty then
beep
answer error "Sorry, no File has been set." with "Okay"
else
beep
answer error "Sorry, I can't find file" && the cFile of me
end if
....etc
The script of the link to program is slightly different:
on mouseUp
if (there is a file (the cFile of me) or there is a folder (the cFile of me)) then
put empty into rslt
if the platform is "MacOS" then
put revmacfromunixpath(the cFile of me) into myFile
put "tell application 'Finder'" & return & "activate" & return & \
"open file'" & myFile & quote & return & "end tell" into myScript
replace "'" with quote in myScript
replace slash with colon in myScript
do myScript as AppleScript
put the result into rslt
else if the platform is "Win32" then
put "start '' '" & the cFile of me & quote into myShell
replace "'" with quote in myShell
get shell(myShell)
put the result into rslt
else
beep
end if
if rslt is empty then
close stack "stormaske"
set the iconic of stack "phenomenalog" to true
else
beep
answer error "Sorry, an error occurred" with "OK"
end if
else if the cFile of me is empty then
beep
answer error "Sorry, no File has been set." with "Okay"
else
beep
answer error "Sorry, I can't find file" && the cFile of me
end if
ikonide
end MouseUp
I must admit that I don't understand what the reference to "result" and rslt means, perhaps an early attempt to repair the bug.
But as even the link to file doesn't function I would disregard it, until further.
Hope somebody have an idea how to repair
best regards
Kresten Bjerg (www.phenomenalog.dk)