This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--To get the path and file name | |
--the effective fileName of this stack | |
--To get just the path this works... | |
set the itemDelimiter to "/" | |
put (item 1 to -2 of the effective fileName of this stack) & "/" into tMyPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Auto saves a stack every 10 mins, easy to convert to save files | |
on openstack | |
dosave | |
end openstack | |
on dosave | |
save this stack | |
send dosave to me in 600 seconds | |
end dosave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--thePaths contains a cr delimited list of valid file/folder path | |
set the hideconsolewindows to true | |
put empty into tErrors | |
repeat for each line tPath in thePaths | |
put theFolder&tPath into tPath | |
if last char of tPath = slash then | |
delete last char of tPath | |
end if | |
replace "/" with "\" in tPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Loads a library stack invisibly for use by a calling stack and makes it ready to use | |
local tPath | |
lock screen | |
//loads the library from disk and inserts it as a library | |
set the itemDel to "/" | |
put the effective filename of stack "myMainStack" into tPath | |
put "MyLibraryStack.livecode" into item -1 of tPath | |
open invisible stack tPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local sgLeftOffset | |
local sgTopOffset | |
local sgDragging | |
on mouseDown | |
put item 1 of the mouseLoc into sgLeftOffset | |
put item 2 of the mouseLoc into sgTopOffset | |
put true into sgDragging | |
end mouseDown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Long Press | |
on mouseDown | |
put the ticks into tStart | |
wait until the mouse is up | |
if the ticks - tStart < 20 then answer "Short Press" | |
else answer "Long Press" | |
end mouseDown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--general timer routine | |
--start button | |
global gStartSeconds | |
global gPauseSeconds | |
on mouseUp | |
--calculate time duration in Seconds | |
put 60*60 into tFactor | |
--convert to seconds, truncate to whole number | |
put trunc(fld "timeDuration" * tFactor) into tDuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Open CD Tray using vbScript | |
--Place a button. | |
--Add this to the mouseUp | |
on mouseUp | |
do the cOpenTray of me as "vbScript" | |
end mouseUp | |
--Create a Custom Property for the button named cOpenTray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on mouseUp | |
put url "http://thisisanexampleurl.com/savedVersion.txt" into theVersion | |
if the currentVersion of this stack < theVersion then | |
put the effective filename of this stack into thePath | |
put url "http://thisisanexampleurl.com/newStack.livecode" into url ("binfile:" & thePath) | |
revert | |
end if | |
end mouseUp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--OSX (and possibly linux distros): | |
put shell("echo $HOSTNAME") | |
--Windows: | |
put $COMPUTERNAME |
OlderNewer