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
--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
--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
--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
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
--Check for program running e.g. Notepad | |
on mouseUp | |
put empty into fld "myTaskList" | |
put shell ("TaskList") into fld "myTaskList" | |
if "notepad.exe" is among the tokens of fld "myTaskList" then | |
answer "Notepad is Running" | |
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
--MD5 Password Generator | |
function hexDigest pvalue | |
put "" into tRes | |
put md5Digest(pValue) into tMD5 | |
get binaryDecode("H*",tMD5,tRes) | |
return tRes | |
end hexDigest |
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
--Gets the colour of a pixel at a x,y co-ordinate | |
--This uses the mouscolor command. | |
on mouseUp | |
put PixelColor(500,500) | |
end mouseUp | |
function PixelColor x,y | |
put the screenMouseLoc into tSaveLoc |
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
--custom properties of stack | |
--cpAppPath : path to app | |
--cpDatabaseID : current active database connection number | |
--cpDataBaseName : name of database to access | |
on openCard | |
mobileOrientation | |
getAppPath | |
nameDataBase |
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
function isBright r,g,b | |
local tbrightness | |
put (r * 299 + g * 587 + b * 114) / 1000 into tbrightness | |
if tbrightness > 125 then | |
return "no" | |
else | |
return "yes" | |
end if | |
end isBright |
OlderNewer