global otgadok_glob
global itm_glob
--etc. on open; on opened; on active;on awake from nib;
on launched theObject
-- tell application "Finder" to display dialog "Hello"
set itm_glob to 2
set otgadok_glob to 1
end launched
on cell value theObject table column tableColumn row theRow
if name of theObject is "TableSlov" then
return "Test"
else if name of theObject is "VsegoTable" then
return itm_glob
else if name of theObject is "UgadanoTable" then
return otgadok_glob
end if
end cell value
on number of rows theObject
if name of theObject is "TableSlov" then
return itm_glob
else
if (name of theObject is "VsegoTable") or (name of theObject is "UgadanoTable") then return 2
end if
end number of rows
AppleScript: The variable itm_glob is not defined (-2753)
AppleScript: The variable otgadok_glob is not defined (-2753)
*** malloc[487]: Deallocation of a pointer not malloced: 0xbfffee80; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[487]: Deallocation of a pointer not malloced: 0xbfffeff0; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[487]: Deallocation of a pointer not malloced: 0xbffff160; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[487]: Deallocation of a pointer not malloced: 0xbffff2d0; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[487]: Deallocation of a pointer not malloced: 0xbffff440; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[487]: Deallocation of a pointer not malloced: 0xbffff5b0; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
property dd : 9
display dialog test
set test to missing value
result:
9
missing value
missing value
missing value
…
The problem in that I cannot set value of a variable at start of the program, earlier than it will start to be used, differently the script from the first letter would not give out mistakes. To force property to receive the primary value it is possible only once
Anyway I can take your example, convert the project to .xcodeproj change the firs 4 rows of ErrorInitTable to
And have it run nicely.
Btw you shouldn’t connnect the Awake from nib of every item, just those you need. And you should check the name of theObject in the handler.
No, artificial giving value of a variable itm_glob, in any of starts is necessary for me. Appropriated value in the real program not a constant. You have received a mistake at use of a global variable? My version XCode:
property pid : 2
on clicked theObject
if title of theObject = "Activate" then
do shell script "/Dev/ClearPDF/clear.sh &> /dev/null & echo $!"
set pid to the result
-- #1
do shell script "renice +20 -p " & pid
--do shell script "kill " & pid
else if title of theObject = "Restore" then
-- #2
display dialog pid
--do shell script "kill " & pid
end if
end clicked
on choose menu item theObject
display dialog "Help"
-- #3
display dialog pid
end choose menu item
Here’s the wierd thing:
#1 → Stores the correct PID value. #2 → Stores nothing (AppleScript gives “pid not defined” error). #3 → Stores the correct PID value.
I’ve gone over all the scope rules several times and I still can’t figure this out. PLEASE help!
Info:
MacBook Pro, OS X 10.4.8, Xcode 2.4.1. All running the most recent updates.