#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" T uRIPides 1 on openStack go card "SplashScreen" end openStack function GetUserPreference pWhich, pDefault local tReturn put pDefault into tReturn if there is a field ("fld" & pWhich) of card "Preferences" of this stack then if field ("fld" & pWhich) of card "Preferences" of this stack is not empty then put field ("fld" & pWhich) of card "Preferences" of this stack into tReturn end if end if return tReturn end GetUserPreference uRIP 1.01.00cConsLastHandlerName GetUserPreference uHelpText }
All uRIP properties are optional.
The recommended set of elements per the ECMI spec is:
name
copyright
creator
date
description
help
homeURL
downloadUrl
interface
EULA
requirements
version
And the suggested elements are:
type
updateInfoURL
props
HelpText All uRIP properties are optional. The recommended set of properties per the ECMI spec is: name copyright creator date description help homeURL downloadUrl interface EULA requirements version type updateInfoURL props cConsLastHandlerScroll 13 U Tahoma W Tahoma W Verdana W Times U Verdana U Verdana U Times U Times W Verdana W Verdana U Courier New U Times U Courier New U Verdana U Times U Times New Roman U Courier New W Courier New U Lucida Grande U Tahoma W Tahoma U tahoma uRIP creator Ah, Software copyright public domaintype pluginhomeURL 'http://www.ahsoftware.net/uRIPides.htmldescription AIDE plugin for manipulating the uRIP custom properties of objects HelpText All uRIP properties are optional. The recommended set of elements per the ECMI spec is: name copyright creator date description help homeURL downloadUrl interface EULA requirements version And the suggested elements are: type updateInfoURL props version 1.02.00EULA cREVOnline fingerprint TpylJZFd0tEszdedbTHeUg cREVGeometryCache stackID 1108 cREVGeneral scriptChecksum bhK@ debugObjects handlerList openStack GetUserPreferencebreakPoints scriptSelection char 44 to 43 bookmarks prevHandler openStacktempScript script Xon openStack
go card "SplashScreen"
end openStack
function GetUserPreference pWhich, pDefault
local tReturn
put pDefault into tReturn
if there is a field ("fld" & pWhich) of card "Preferences" of this stack then
if field ("fld" & pWhich) of card "Preferences" of this stack is not empty then
put field ("fld" & pWhich) of card "Preferences" of this stack into tReturn
end if
end if
return tReturn
end GetUserPreference
Widgets @ cREVGeometryCacheIDs 1129307691827 10371129308383164 10421129360437572 10621129305951995 10351129567770366 10661129315511249 10451129665246184 11061129217496239 10221129315056808 10441129591345324 10891129168030506 10051129217191333 10201129608696581 10921129582531046 1070 cREVGeometryCache order total 14 cREVGeneral bookmarks handlerList prevHandler tempScript script * . A D & R E About P [on openCard put the uRIP["version"] of this stack into field "fldVersion" end openCard cREVGeneral scriptChecksum Ӹn!4 bookmarks handlerList openCardscriptSelection char 38 to 37prevHandler tempScript scripton openCard
put the uRIP["version"] of this stack into field "fldVersion"
end openCard
cREVGeometryCacheIDs 1129665563256 11071129609023361 10981129665649882 11081129608844638 10961129608877335 10971129608769033 1094 cREVGeometrycache total 6order F H I J S T SplashScreen P >on openCard wait 1 second go card "Widgets" end openCard cREVGeometryCacheIDs 1129615031788 1099 cREVGeometryCache order total 1 cREVGeneral scriptChecksum R<:FcH+vFy bookmarks handlerList openCardtempScript prevHandler openCardscriptSelection char 31 to 30scripton openCard
wait 1 second
go card "Widgets"
end openCard
K InfoEditor P----------------------------------------------------------- -- Generic check to check for latest version. -- Part of the uRIPides collection. -- -- This now conforms to the ECMI standard: -- There is an xml file on a web server with the update info containing: -- latest version -- update url -- release notes -- -- This requires the following custom properties to be set up: -- uRIP["version"] -- uRIP["updateInfoURL"] -- uRIP["version"] -- -- Fixing up the two constants and then running the _RIPSetup -- handler sets up the custom properties -- -- The xml file contains, at a minimum, the following per the ECMI spec: -------------------------------------------------------------
-- Generic check to check for latest version.
-- Part of the uRIPides collection.
--
-- This now conforms to the ECMI standard:
-- There is an xml file on a web server with the update info containing:
-- latest version
-- update url
-- release notes
--
-- This requires the following custom properties to be set up:
-- uRIP["version"]
-- uRIP["updateInfoURL"]
-- uRIP["version"]
--
-- Fixing up the two constants and then running the _RIPSetup
-- handler sets up the custom properties
--
-- The xml file contains, at a minimum, the following per the ECMI spec:
-- <rip>
-- <file>
-- <version>currentVersionNumber</version>
-- <downloadURL>downloadURL</downloadURL>
-- </file>
-- </rip>
-----------------------------------------------------------
-- this is the current version
constant kVersion=1.00.00
-- this is the location of the info file
constant kDownloadURL="http://www.runrev.com/files/ECMI.xml"
local tDirty
-----------------------------------------------------------
-- openCard
-----------------------------------------------------------
on openCard
local tRIPxml
local tDate
put the date into tDate
convert tDate to dateItems
if the uRIP["updateInfoURL"] of stack the topstack is not empty then
put the uRIP["updateInfoURL"] of stack the topstack into tRIPxml
else
put "<rip>" & cr & \
tab & "<file>" & cr & \
tab & tab & "<name>" & the short name of the topstack & "</name>" & cr & \
tab & tab & "<version>" & kVersion & "</version>" & cr & \
tab & tab & "<releaseDate>" & item 1 to 3 of tDate & "</releaseDate>" & cr & \
tab & tab & "<downloadURL>" & kDownloadURL & "</downloadURL>" & cr & \
tab & "</file>" & cr & \
"</rip>" & cr into tRIPxml
end if
put tRIPxml into field "fldInfo"
put false into tDirty
end openCard
on selectionChanged
put true into tDirty
end selectionChanged
on CleanDirty
put false into tDirty
end CleanDirty
function IsDirty
return tDirty
end IsDirty
) uRIPEditor Plocal lTargetObject local lRIPProp on openCard put empty into field "uProps" put empty into field "fldContents" RIPInitialize put empty into lTargetObject end openCard on RIPInitialize put empty into lRIPProp end RIPInitialize function GatherRIPProps pTarget local tProps, tKeys local tPropValues put pTarget into lTargetObject RIPInitialize put the customProperties["uRIP"] of lTargetObject into tProps put the keys of tProps into tKeys repeat for each line tKey in tKeys put tKey & cr after tPropValues end repeat return tPropValues end GatherRIPProps on GetRIPProp pWhich put pWhich into lRIPProp get the uRIP[pWhich] of lTargetObject if char 1 to 3 of it is "" then set the htmlText of field "fldContents" to the uRIP[pWhich] of lTargetObject else put the uRIP[pWhich] of lTargetObject into field "fldContents" end if end GetRIPProp on SetRIPProp pWhich local tValue switch pWhich case "date" put the date into tValue convert tValue to dateItems put item 1 to 3 of tValue into tValue default put "newValue" into tValue end switch put empty into field "uProps" set the uRIP[pWhich] of lTargetObject to "newValue" put GatherRIPProps(lTargetObject) into field "uProps" end SetRIPProp on SaveRIPProp local tKeys, tHTMLContents if field "fldContents" is not empty then put the htmlText of field "fldContents" into tHTMLContents put field "fldContents" into field "tContents" if the htmlText of field "tContents" is tHTMLContents then set the uRIP[lRIPProp] of lTargetObject to field "fldContents" else set the uRIP[lRIPProp] of lTargetObject to the htmlText of field "fldContents" end if put empty into field "fldContents" else if lRIPProp is not empty and the selectedText is empty then put empty into field "uProps" set the customPropertySet of lTargetObject to "uRIP" put the customKeys of lTargetObject into tKeys filter tKeys without lRIPProp set the customKeys of lTargetObject to tKeys set the customPropertySet of lTargetObject to empty put GatherRIPProps(lTargetObject) into field "uProps" end if end if end SaveRIPProp cREVGeometryCacheIDs 1129330452208 10501129177808014 10131129615843163 11001129177801132 10111129572951810 10681129335255879 10551129217384645 10211129308162114 10391129217134198 10171129615881430 11011129315554950 10461129336223498 10541129177782467 10081129331412344 1051 cREVGeometrycache total 14order cREVGeneral scriptChecksum qgJKdQu!M bookmarks handlerList GopenCard RIPInitialize GatherRIPProps GetRIPProp SetRIPProp SaveRIPPropbreakPoints tempScript prevHandler GatherRIPPropsscriptSelection char 1823 to 1822script
local lTargetObject
local lRIPProp
on openCard
put empty into field "uProps"
put empty into field "fldContents"
RIPInitialize
put empty into lTargetObject
end openCard
on RIPInitialize
put empty into lRIPProp
end RIPInitialize
function GatherRIPProps pTarget
local tProps, tKeys
local tPropValues
put pTarget into lTargetObject
RIPInitialize
put the customProperties["uRIP"] of lTargetObject into tProps
put the keys of tProps into tKeys
repeat for each line tKey in tKeys
put tKey & cr after tPropValues
end repeat
return tPropValues
end GatherRIPProps
on GetRIPProp pWhich
put pWhich into lRIPProp
get the uRIP[pWhich] of lTargetObject
if char 1 to 3 of it is "<p>" then
set the htmlText of field "fldContents" to the uRIP[pWhich] of lTargetObject
else
put the uRIP[pWhich] of lTargetObject into field "fldContents"
end if
end GetRIPProp
on SetRIPProp pWhich
local tValue
switch pWhich
case "date"
put the date into tValue
convert tValue to dateItems
put item 1 to 3 of tValue into tValue
default
put "newValue" into tValue
end switch
put empty into field "uProps"
set the uRIP[pWhich] of lTargetObject to "newValue"
put GatherRIPProps(lTargetObject) into field "uProps"
end SetRIPProp
on SaveRIPProp
local tKeys, tHTMLContents
if field "fldContents" is not empty then
put the htmlText of field "fldContents" into tHTMLContents
put field "fldContents" into field "tContents"
if the htmlText of field "tContents" is tHTMLContents then
set the uRIP[lRIPProp] of lTargetObject to field "fldContents"
else
set the uRIP[lRIPProp] of lTargetObject to the htmlText of field "fldContents"
end if
put empty into field "fldContents"
else
if lRIPProp is not empty and the selectedText is empty then
put empty into field "uProps"
set the customPropertySet of lTargetObject to "uRIP"
put the customKeys of lTargetObject into tKeys
filter tKeys without lRIPProp
set the customKeys of lTargetObject to tKeys
set the customPropertySet of lTargetObject to empty
put GatherRIPProps(lTargetObject) into field "uProps"
end if
end if
end SaveRIPProp
M L , / Preferences Pon openCard local x local tField local tPrefsFolder repeat with x=1 to the number of fields of this card if not the lockText of field x then put empty into field x end if end repeat if the platform is "Win32" then put specialFolderPath(26) into tPrefsFolder else put specialFolderPath("Preferences") into tPrefsFolder end if if there is a file (tPrefsFolder & "/uRIPides.xml") then RetrieveXMLPrefs tPrefsFolder end if end openCard on RetrieveXMLPrefs pPrefsFolder local tTree local tRootNode, tNode, tElement put revCreateXMLTreeFromFile(pPrefsFolder & "/uRIPides.xml",false,true,false) into tTree put revXMLRootNode(tTree) into tRootNode put revXMLFirstChild(tTree, tRootNode) into tNode set the itemDelimiter to "/" repeat while tNode is not empty put revXMLNodeContents(tTree, tNode) into tElement put tElement into field ("fld" & the last item of tNode) put revXMLNextSibling(tTree, tNode) into tNode end repeat end RetrieveXMLPrefs cREVGeneral scriptChecksum EmWlA[iV` bookmarks breakPoints handlerList openCard RetrieveXMLPrefsscriptSelection char 937 to 936prevHandler openCardtempScript script "on openCard
local x
local tField
local tPrefsFolder
repeat with x=1 to the number of fields of this card
if not the lockText of field x then
put empty into field x
end if
end repeat
if the platform is "Win32" then
put specialFolderPath(26) into tPrefsFolder
else
put specialFolderPath("Preferences") into tPrefsFolder
end if
if there is a file (tPrefsFolder & "/uRIPides.xml") then
RetrieveXMLPrefs tPrefsFolder
end if
end openCard
on RetrieveXMLPrefs pPrefsFolder
local tTree
local tRootNode, tNode, tElement
put revCreateXMLTreeFromFile(pPrefsFolder & "/uRIPides.xml",false,true,false) into tTree
put revXMLRootNode(tTree) into tRootNode
put revXMLFirstChild(tTree, tRootNode) into tNode
set the itemDelimiter to "/"
repeat while tNode is not empty
put revXMLNodeContents(tTree, tNode) into tElement
put tElement into field ("fld" & the last item of tNode)
put revXMLNextSibling(tTree, tNode) into tNode
end repeat
end RetrieveXMLPrefs
cREVGeometryCacheIDs 1129588916260 10771129588900070 10761129588916261 10781129588808449 10751129589005748 10831129589005749 10841129591493675 10911129588912022 10791129588939930 10811129588939929 10801129589199123 10881129588801639 10731129588934615 10821129589000937 1085 cREVGeometrycache order total 14 4 5 8 ; @ C btnCheckUpdate ep----------------------------------------------------------- -- Generic check to check for latest version. -- Part of the uRIPides collection. -- -- This now conforms to the ECMI standard: -- There is an xml file on a web server with the update info containing: -- latest version -- update url -- release notes -- -- This requires the following custom properties of this button to be set up: -- uRIP["name"] -- uRIP["updateInfoURL"] -- uRIP["version"] -- -- Fixing up the two constants and then running the _RIPSetup -- handler sets up the custom properties -- -- The xml file contains, at a minimum, the following per the ECMI spec: -------------------------------------------------------------
-- Generic check to check for latest version.
-- Part of the uRIPides collection.
--
-- This now conforms to the ECMI standard:
-- There is an xml file on a web server with the update info containing:
-- latest version
-- update url
-- release notes
--
-- This requires the following custom properties of this button to be set up:
-- uRIP["name"]
-- uRIP["updateInfoURL"]
-- uRIP["version"]
--
-- Fixing up the two constants and then running the _RIPSetup
-- handler sets up the custom properties
--
-- The xml file contains, at a minimum, the following per the ECMI spec:
-- <rip>
-- <file>
-- <version>currentVersionNumber</version>
-- <downloadURL>downloadURL</downloadURL>
-- </file>
-- </rip>
-----------------------------------------------------------
-----------------------------------------------------------
-- mouseUp
--
-- Get our current version info,
-- compare it with the latest on the web.
-- If we're up to date, just tell the user so.
-- Otherwise launch a browser to start a download.
-- If there are release notes and there's a field in the
-- current environment called "ReleaseNotes" then show them.
-----------------------------------------------------------
on mouseUp
local tLatestVersion
local tWebLocation
local tTree, tNodes, tNum, tStackName, tSpec
local tResult
-- set up the custom properties based on the constant values
set the cursor to busy
-- get the info for the most current version
put url(the uRIP["updateInfoURL"] of me) into tWebLocation
put the result into tResult
if tResult is not empty then
switch tResult
case "error 404 not found"
answer the uRIP["updateInfoURL"] of me && "not found"
break
default
answer tResult
end switch
else
replace lf with cr in tTree
put revCreateXMLTree(tWebLocation, false, true, false) into tTree
if "xmlerr" is not in tTree then
put revXMLNumberOfChildren(tTree, "/rip", "file", -1) into tNum
put revXMLFirstChild(tTree, "/rip") into tSpec
put revXMLNodeContents(tTree, tSpec & "/name") into tStackName
repeat while tStackName is not the uRIP["name"] of me
put revXMLNextSibling(tTree, tSpec) into tSpec
if tSpec is empty then
exit repeat
end if
put revXMLNodeContents(tTree, tSpec & "/name") into tStackName
if "xmlerr" is in tStackName then
exit repeat
end if
end repeat
if tSpec is not empty then
-- get the latest version number
put revXMLNodeContents(tTree, tSpec & "/version") into tLatestVersion
if tLatestVersion > the uRIP["version"] of me then
-- get the release notes
if there is a field "ReleaseNotes" then
get revXMLNodeContents(tTree, tSpec & "/releaseNotes")
if it is not empty then
put it into field "ReleaseNotes"
end if
end if
-- get the download url
put revXMLNodeContents(tTree, tSpec & "/downloadURL") into tNodes
revGoUrl (tNodes)
else
answer "Your version is current."
end if
end if
end if
end if
set the cursor to arrow
end mouseUp
uProps )pon mouseUp pWhichButton switch pWhichButton case 3 if the selectedText of me is not empty then answer "delete this property?" with "Yes" and "No" if it is "Yes" then end if else ask "what RIP property name?" if it is not empty then SetRIPProp it end if end if break default SaveRIPProp if the selectedText of me is not empty then GetRIPProp the selectedText of me end if end switch end mouseUp cREVGeneral scriptChecksum ˹$JihhandlerList mouseUpbreakPoints scriptSelection char 438 to 437revUniqueID 1129177782467 bookmarks tempScript prevHandler mouseUpscript Lon mouseUp pWhichButton
switch pWhichButton
case 3
if the selectedText of me is not empty then
answer "delete this property?" with "Yes" and "No"
if it is "Yes" then
end if
else
ask "what RIP property name?"
if it is not empty then
SetRIPProp it
end if
end if
break
default
SaveRIPProp
if the selectedText of me is not empty then
GetRIPProp the selectedText of me
end if
end switch
end mouseUp
` @ btnStackProps ep on mouseUp local tTarget RIPInitialize put empty into field "uProps" put empty into field "fldContents" put the long name of stack the topstack into tTarget put GatherRIPProps(tTarget) into field "uProps" end mouseUp 2 ^ the topStack Stack properties cREVGeneral scriptChecksum {Tm74z'0_7breakPoints handlerList mouseUpscriptSelection char 46 to 45 bookmarks revUniqueID 1129177801132prevHandler mouseUptempScript script fon mouseUp
local tTarget
RIPInitialize
put empty into field "uProps"
put empty into field "fldContents"
put the long name of stack the topstack into tTarget
put GatherRIPProps(tTarget) into field "uProps"
end mouseUp
btnDone mp #on mouseUp pop card end mouseUp 9w R Done cREVGeneral scriptChecksum ސef f;SCrevUniqueID 1129177808014 bookmarks handlerList mouseUptempScript prevHandler mouseUpscriptSelection char 22 to 21scripton mouseUp
pop card
end mouseUp
fldContents )` vZ cREVGeneral revUniqueID 1129217134198 ` @ w btnEditor ep ;on mouseUp push card go card "uRIPEditor" end mouseUp y uRIP Editor cREVGeneral scriptChecksum 4revUniqueID 1129217191333 bookmarks handlerList mouseUptempScript prevHandler mouseUpscriptSelection char 23 to 22scripton mouseUp
push card
go card "uRIPEditor"
end mouseUp
btnCardProps ep on mouseUp local tTarget put empty into field "uProps" put empty into field "fldContents" put line 1 of the recentCards of stack the topstack into tTarget put GatherRIPProps(tTarget) into field "uProps" end mouseUp 2 5 ^ !The current card of the topStack Card properties cREVGeneral scriptChecksum 2sz TTSTqhandlerList mouseUpbreakPoints scriptSelection char 77 to 76revUniqueID 1129217384645 bookmarks tempScript prevHandler mouseUpscript [on mouseUp
local tTarget
put empty into field "uProps"
put empty into field "fldContents"
put line 1 of the recentCards of stack the topstack into tTarget
put GatherRIPProps(tTarget) into field "uProps"
end mouseUp
btnInfoEditor ep ;on mouseUp push card go card "InfoEditor" end mouseUp " y updateInfoURL Editor cREVGeneral scriptChecksum oE~ bookmarks revUniqueID 1129217496239handlerList mouseUpscriptSelection char 23 to 22prevHandler mouseUptempScript scripton mouseUp
push card
go card "InfoEditor"
end mouseUp
btnDone mp\-- this is the name of the file to save constant kFileName="uRIPides.xml" on mouseUp local tFileName if IsDirty() then ask file "Where should the xml file be saved?" with kFileName if it is not empty then put it into tFileName put field "fldInfo" into url ("file:"&tFileName) end if end if pop card end mouseUp 7m R Done cREVGeneral scriptChecksum Y_/i rrevUniqueID 1129217586886 bookmarks handlerList mouseUptempScript prevHandler mouseUpscriptSelection char 335 to 334script m-- this is the name of the file to save
constant kFileName="uRIPides.xml"
on mouseUp
local tFileName
if IsDirty() then
ask file "Where should the xml file be saved?" with kFileName
if it is not empty then
put it into tFileName
put field "fldInfo" into url ("file:"&tFileName)
end if
end if
pop card
end mouseUp
fldInfo i` +,j cREVGeneral revUniqueID 1129217620224 bookmarks handlerList tempScript prevHandler script