#!/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 "$@" jManaging Drag and Drop3Q/* Decorations Stack By Eric Chatonet 3/6/05 http://www.sosmartsoftware.com/ */ @: Files and Folders Drag and Drop:D ULucida Grande ULucida Grande WLucida Grande WLucida Grande WCourier UCourier UCourier UCourier AULucida Grande @ULucida Grande U HelveticaU Helvetica UGeorgiaUGeorgia U Verdana-BoldU Verdana-BoldW Verdana-Bold UGenevaUGenevaWGeneva WGeneva UGeneva U Verdana-Bold W Verdana-BoldULucida GrandeWLucida GrandeULucida GrandeWLucida GrandeULucida GrandeAULucida GrandeWLucida Grande ULucida GrandeULucida Grande"ULucida Grande"WLucida Grande@ULucida GrandeWLucida Grande WLucida Grande AWLucida GrandeAWLucida GrandeULucida GrandeWLucida GrandeULucida GrandeWLucida GrandeWLucida Grande@ULucida GrandeWLucida GrandeAWLucida GrandeWLucida GrandeAWLucida Grande ULucida Grande @WLucida Grande ULucidaGrande-BoldULucidaGrande-BoldWLucidaGrande-Bold U LucidaGrandeU LucidaGrandeULucidaGrande-BoldWLucidaGrande-BoldULucidaGrande-BoldWLucidaGrande-BoldU LucidaGrande UArialMTUArialMTUArialMTU HelveticaW HelveticaU HelveticaPulldown MenucREVGeometryCachestackID1130 cREVGeneral scriptChecksum9pAu69Q debugObjects breakPoints handlerListscriptSelection char 42 to 41 bookmarks tempScript prevHandlercommandKeyDownscripta

/*

Decorations Stack

By Eric Chatonet

3/6/05

http://www.sosmartsoftware.com/

*/

 P,iconstant kImages = "JPEG,jpg,GIFf,gif,PNGf,png,PICT,BMP ,bmp", kSounds = "AIFF,aif,VfW ,M4A ,m4a,Mp3 ,mp3,WAVE,wav" constant kVideos = "avi,mov,MooV", kTexts = "txt,TEXT,rtf,htm,html", kStacks = "mc,rev,rstk" ------------------------------------ on preOpenStack set the style of this stack to "modeless" set the loc of this stack to the screenLoc end preOpenStack ------------------------------------ on dragEnter if the short name of the target = "DADZone" then set the acceptDrop to true -- we accept drag and drop within this area end dragEnter ------------------------------------ on dragDrop -- sent by the engine when data are dropped local tDefaultFolder ----- if the dragData = empty then exit dragDrop -- error stop player "Test" -- our demo test ----- if the dragData["files"] = empty then -- it is text or another kind of data put empty into fld "DragData" put "Not files or folders" into fld "NumOfItems" ShowFile -- -- see below ShowFile handler which displays the data with the right control in our demo: player, image or field exit dragDrop else put the defaultFolder into tDefaultFolder -- save the current default folder ----- switch the hilitedButton of grp "radio" case 1 -- first row files put DisplayFirstRowFiles(the dragData) into fld "DragData" -- -- see this function below break case 2 -- all files put DisplayAllFiles(the dragData) into fld "DragData" -- -- see this function below break case 3 -- folders put DisplayFolders(the dragData) into fld "DragData" -- -- see this function below break end switch ----- for our demo: if fld "DragData" <> empty then set the hilitedLine of fld "DragData" to 1 if the hilitedButton of grp "radio" = 3 then put the number of lines of fld "DragData" && "folders found" into fld "NumOfItems" else put the number of lines of fld "DragData" && "files found" into fld "NumOfItems" else put "No matches found" into fld "NumOfItems" end if ----- set the defaultFolder to tDefaultFolder -- restore the default folder ----- ShowFile -- -- see below ShowFile handler which displays the data with the right control in our demo: player, image or field end if end dragDrop ------------------------------------ function DisplayFirstRowFiles pDragData local tData,tType,tFilesList ----- repeat for each line tData in pDragData set the cursor to busy if there is a file tData then -- we want files only ----- -- put tData & cr after tFilesList -- for a simple paths list ----- put WhichFileType(tData) into tType -- for our demo: -- see below: WhichFileType function returns the file type put "File" & tab & tType & tab & WhichDestControl(tType) & tab & tData & cr after tFilesList -- see below: WhichDestControl function returns the control type needed for displaying the dropped data end if end repeat delete last char of tFilesList -- return char put FilterList(tFilesList) into tFilesList -- return tFilesList end DisplayFirstRowFiles ------------------------------------ function DisplayAllFiles pDragData local tData,tRawFilesList,tType,tFilesList ----- set the itemDel to slash repeat for each line tData in pDragData set the cursor to busy if there is a file tData then put tData & cr after tRawFilesList else -- it is a folder put UrlDecode(AllFiles(tData,true)) & cr after tRawFilesList -- see below: AllFiles function returns all files in a folder and all its sub folders end if end repeat delete last char of tRawFilesList ----- -- return tRawFilesList -- for a simple paths list ----- repeat for each line tFile in tRawFilesList -- for our demo: put WhichFileType(tFile) into tType -- see below: WhichFileType function returns the file type put "File" & tab & tType & tab & WhichDestControl(tType) & tab & tFile & cr after tFilesList -- see below: WhichDestControl function returns the control type needed for displaying the dropped data end repeat delete last char of tFilesList -- return char put FilterList(tFilesList) into tFilesList -- return tFilesList end DisplayAllFiles ------------------------------------ function DisplayFolders pDragData local tData,tFoldersList ----- repeat for each line tData in pDragData set the cursor to busy if there is a folder tData then ----- -- put tData & cr after tFoldersList -- for a simple paths list ----- put "Folder" & tab & "-" & tab & "-" & tab & tData & cr after tFoldersList -- for our demo end if end repeat delete last char of tFoldersList -- return char return tFoldersList end DisplayFolders --------------------------------- function AllFiles pFolder,pAddFullPath,pAllInfos -- modified from Frederic Rinaldi's local tStartFolder,tFilesList,tLoopFolder,tFoldersList,tResultList,tList ----- if last char of pFolder is not slash then put slash after pFolder if tStartFolder is empty then put pFolder into tStartFolder ----- set the defaultFolder to pFolder if the result is not empty then beep answer error "Could not find directory:" & return & return & pFolder as sheet exit to top end if ----- put the detailed files into tFilesList filter tFilesList without ".*" filter tFilesList without "Icon%0D*" filter tFilesList without "*,MACSfdrp" -- remove folder aliases ----- put the folders into tFoldersList filter tFoldersList without ".*" filter tFoldersList without "*.*" -- app bundles on Mac OS X ----- repeat for each line tLoopFolder in tFoldersList set the cursor to busy put AllFiles(pFolder & tLoopFolder & "/",pAddFullPath,pAllInfos) & return after tResultList -- end repeat ----- repeat with i = the number of lines of tFilesList down to 1 if pAddFullPath then put MyURLEncode(pFolder) before line i of tFilesList -- if not pAllInfos then put item 1 of line i of tFilesList into line i of tFilesList end repeat ----- put tResultList & tFilesList into tList sort lines of tList return word 1 to -1 of tList end AllFiles --------------------------------- function MyURLEncode what put URLEncode(what) into what replace "%2F" with slash in what return what end MyURLEncode ------------------------------------ function FilterList pList if the enabled of btn "FilesType" then switch the label of btn "FilesType" case "All Types" return pList case "Text Files" put kTexts into tFilter -- constant declared at the top of this script break case "Image Files" put kImages into tFilter -- dito break case "Sound Files" put kSounds into tFilter break case "Video Files" put kVideos into tFilter end switch ----- set the itemDel to tab repeat for each line tFile in pList if item 2 of tFile is in tFilter then put tFile & cr after tFilteredList end repeat delete last char of tFilteredList else return pList return tFilteredList end FilterList ------------------------------------ on ShowFile set the cursor to watch set the itemDel to tab put the hilitedText of fld "DragData" into tFile ----- lock screen hide img "Test" stop player "Test" hide player "Test" hide fld "Test" if tFile = empty then exit ShowFile ----- switch item 3 of tFile case "stack" go stack item 4 of tFile break ----- case "image" set the fileName of image "Test" to item 4 of tFile show img "Test" break ----- case "player" set the fileName of player "Test" to item 4 of tFile show player "Test" start player "Test" -- here all sounds are played by the test player: some of them could be played by the play command break ----- case "field" switch case item 2 of tFile is in "html" set the htmlText of fld "Test" to url("file:" & item 4 of tFile) break case item 2 of tFile = "rtf" set the rtfText of fld "Test" to url("file:" & item 4 of tFile) break default set the text of fld "Test" to url("file:" & item 4 of tFile) end switch show fld "Test" end switch unlock screen set the cursor to empty end ShowFile ------------------------------------ function WhichFileType pFile put Extension(pFile) into tType -- switch tType case "error: could not find extension" -- on Mac OS we try to get the file type switch the platform case "MacOS" return FileInfo(pFile,"type") break ----- default return "????" end switch break ----- default return tType end switch end WhichFileType --------------------------------- function WhichDestControl pType switch case pType is among the items of kImages -- constant declared at the top of this script return "image" break case pType is among the items of kTexts -- dito return "field" break case (pType is among the items of kSounds) or (pType is among the items of kVideos) return "player" break case pType is among the items of kStacks return "stack" break default return "????" end switch end WhichDestControl --------------------------------- function Extension pFilePath local tFileName ----- set the itemDel to slash put item -1 of pFilePath into tFileName if "." is not in tFileName then return "error: could not find extension" repeat with i = the number of chars of tFileName down to 1 if char i of tFileName = "." then exit repeat end repeat if (i+5) < the number of chars of tFileName then return "error: could not find extension" return char (i+1) to (the number of chars of tFileName) of tFileName end Extension --------------------------------- function FileInfo pFile,pInfo local tDefaultFolder,tFiles,tFilter,tSize,tDate,tType,tCreator ----- set the itemDel to slash set the defaultFolder to item 1 to -2 of pFile -- parent folder put urldecode(the long files) into tFiles filter tFiles with last item of pFile & "*" ----- set the itemDel to comma switch pInfo case "size" put item 2 of tFiles + item 3 of tFiles into tSize put tSize div 1024 into tSize if tSize > 1000 then set the numberFormat to "0.0" put tSize / 1024 && "Mb" into tSize else put tSize && "Kb" into tSize return tSize break case "creation" put item 4 of tFiles into tDate convert tDate from seconds to system date and system time return tDate break case "modification" put item 5 of tFiles into tDate convert tDate from seconds to system date and system time return tDate break case "type" put char -4 to -1 of item 11 of tFiles into tType if tType = empty then return "????" else return tType break case "creator" put char -8 to -5 of item 11 of tFiles into tCreator if tCreator = empty then return "????" else return tCreator end switch end FileInfo --------------------------------- on CleanStack put empty into fld "DragData" put empty into fld "NumOfItems" set the fileName of player "Test" to empty set the fileName of img "Test" to empty ShowFile -- save this stack put "Done" end CleanStack :cREVGeometryCacheIDs11101807191821120111018164174011221110184068411112511101819031371124111012798199511031109849448492107211101937273581127111018071451311181110128395730110711101171055421092111012946893211111109350253372101411102109785801130110934780149710061110121840757109911101807171571119111018085580311211110121734336109811093502990731016111012891819911091109350346443160011101216211641097cREVGeometrycacheorder1109849448492 1110184068411 total22 cREVGeneralscriptChecksum&K5v.w bookmarks handlerListpreOpenStack dragEnter dragDrop DisplayFirstRowFiles DisplayAllFiles DisplayFolders AllFiles MyURLEncode FilterList ShowFile WhichFileType WhichDestControl Extension FileInfo CleanStack breakPointsscriptSelectionchar 371 to 370 prevHandler FilterList tempScriptscriptu

constant kImages = "JPEG,jpg,GIFf,gif,PNGf,png,PICT,BMP ,bmp", kSounds = "AIFF,aif,VfW ,M4A ,m4a,Mp3 ,mp3,WAVE,wav"

constant kVideos = "avi,mov,MooV", kTexts = "txt,TEXT,rtf,htm,html", kStacks = "mc,rev,rstk"

------------------------------------

on preOpenStack

set the style of this stack to "modeless"

set the loc of this stack to the screenLoc

end preOpenStack

------------------------------------

on dragEnter

if the short name of the target = "DADZone" then set the acceptDrop to true

-- we accept drag and drop within this area

end dragEnter

------------------------------------

on dragDrop -- sent by the engine when data are dropped

local tDefaultFolder

-----

if the dragData = empty then exit dragDrop -- error

stop player "Test" -- our demo test

-----

if the dragData["files"] = empty then

-- it is text or another kind of data

put empty into fld "DragData"

put "Not files or folders" into fld "NumOfItems"

ShowFile -- 

-- see below ShowFile handler which displays the data with the right control in our demo: player, image or field

exit dragDrop

else

put the defaultFolder into tDefaultFolder -- save the current default folder

-----

switch the hilitedButton of grp "radio"

case 1 -- first row files

put DisplayFirstRowFiles(the dragData) into fld "DragData" -- 

-- see this function below

break

case 2 -- all files

put DisplayAllFiles(the dragData) into fld "DragData" -- 

-- see this function below

break

case 3 -- folders

put DisplayFolders(the dragData) into fld "DragData" -- 

-- see this function below

break

end switch

----- for our demo:

if fld "DragData" <> empty then

set the hilitedLine of fld "DragData" to 1

if the hilitedButton of grp "radio" = 3 then put the number of lines of fld "DragData" && "folders found" into fld "NumOfItems"

else put the number of lines of fld "DragData" && "files found" into fld "NumOfItems"

else

put "No matches found" into fld "NumOfItems"

end if

-----

set the defaultFolder to tDefaultFolder -- restore the default folder

-----

ShowFile -- 

-- see below ShowFile handler which displays the data with the right control in our demo: player, image or field

end if

end dragDrop

------------------------------------

function DisplayFirstRowFiles pDragData

local tData,tType,tFilesList

-----

repeat for each line tData in pDragData

set the cursor to busy

if there is a file tData then -- we want files only

-----

-- put tData & cr after tFilesList -- for a simple paths list

-----

put WhichFileType(tData) into tType -- for our demo:

-- see below: WhichFileType function returns the file type

put "File" & tab & tType & tab & WhichDestControl(tType) & tab & tData & cr after tFilesList

-- see below: WhichDestControl function returns the control type needed for displaying the dropped data

end if

end repeat

delete last char of tFilesList -- return char

put FilterList(tFilesList) into tFilesList -- 

return tFilesList

end DisplayFirstRowFiles

------------------------------------

function DisplayAllFiles pDragData

local tData,tRawFilesList,tType,tFilesList

-----

set the itemDel to slash

repeat for each line tData in pDragData

set the cursor to busy

if there is a file tData then

put tData & cr after tRawFilesList

else -- it is a folder

put UrlDecode(AllFiles(tData,true)) & cr after tRawFilesList

-- see below: AllFiles function returns all files in a folder and all its sub folders

end if

end repeat

delete last char of tRawFilesList

-----

-- return tRawFilesList -- for a simple paths list

-----

repeat for each line tFile in tRawFilesList -- for our demo:

put WhichFileType(tFile) into tType

-- see below: WhichFileType function returns the file type

put "File" & tab & tType & tab & WhichDestControl(tType) & tab & tFile & cr after tFilesList

-- see below: WhichDestControl function returns the control type needed for displaying the dropped data

end repeat

delete last char of tFilesList -- return char

put FilterList(tFilesList) into tFilesList -- 

return tFilesList

end DisplayAllFiles

------------------------------------

function DisplayFolders pDragData

local tData,tFoldersList

-----

repeat for each line tData in pDragData

set the cursor to busy

if there is a folder tData then

-----

-- put tData & cr after tFoldersList -- for a simple paths list

-----

put "Folder" & tab & "-" & tab & "-" & tab & tData & cr after tFoldersList -- for our demo

end if

end repeat

delete last char of tFoldersList -- return char

return tFoldersList

end DisplayFolders

---------------------------------

function AllFiles pFolder,pAddFullPath,pAllInfos -- modified from Frederic Rinaldi's

local tStartFolder,tFilesList,tLoopFolder,tFoldersList,tResultList,tList

-----

if last char of pFolder is not slash then put slash after pFolder

if tStartFolder is empty then put pFolder into tStartFolder

-----

set the defaultFolder to pFolder

if the result is not empty

then

beep

answer error "Could not find directory:" & return & return & pFolder as sheet

exit to top

end if

-----

put the detailed files into tFilesList

filter tFilesList without ".*"

filter tFilesList without "Icon%0D*"

filter tFilesList without "*,MACSfdrp" -- remove folder aliases

-----

put the folders into tFoldersList

filter tFoldersList without ".*"

filter tFoldersList without "*.*" -- app bundles on Mac OS X

-----

repeat for each line tLoopFolder in tFoldersList

set the cursor to busy

put AllFiles(pFolder & tLoopFolder & "/",pAddFullPath,pAllInfos) & return after tResultList -- 

end repeat

-----

repeat with i = the number of lines of tFilesList down to 1

if pAddFullPath then put MyURLEncode(pFolder) before line i of tFilesList -- 

if not pAllInfos then put item 1 of line i of tFilesList into line i of tFilesList

end repeat

-----

put tResultList & tFilesList into tList

sort lines of tList

return word 1 to -1 of tList

end AllFiles

---------------------------------

function MyURLEncode what

put URLEncode(what) into what

replace "%2F" with slash in what

return what

end MyURLEncode

------------------------------------

function FilterList pList

if the enabled of btn "FilesType" then

switch the label of btn "FilesType"

case "All Types"

return pList

case "Text Files"

put kTexts into tFilter -- constant declared at the top of this script

break

case "Image Files"

put kImages into tFilter -- dito

break

case "Sound Files"

put kSounds into tFilter

break

case "Video Files"

put kVideos into tFilter

end switch

-----

set the itemDel to tab

repeat for each line tFile in pList

if item 2 of tFile is in tFilter then put tFile & cr after tFilteredList

end repeat

delete last char of tFilteredList

else return pList

return tFilteredList

end FilterList

------------------------------------

on ShowFile

set the cursor to watch

set the itemDel to tab

put the hilitedText of fld "DragData" into tFile

-----

lock screen

hide img "Test"

stop player "Test"

hide player "Test"

hide fld "Test"

if tFile = empty then exit ShowFile

-----

switch item 3 of tFile

case "stack"

go stack item 4 of tFile

break

-----

case "image"

set the fileName of image "Test" to item 4 of tFile

show img "Test"

break

-----

case "player"

set the fileName of player "Test" to item 4 of tFile

show player "Test"

start player "Test"

-- here all sounds are played by the test player: some of them could be played by the play command

break

-----

case "field"

switch

case item 2 of tFile is in "html"

set the htmlText of fld "Test" to url("file:" & item 4 of tFile)

break

case item 2 of tFile = "rtf"

set the rtfText of fld "Test" to url("file:" & item 4 of tFile)

break

default

set the text of fld "Test" to url("file:" & item 4 of tFile)

end switch

show fld "Test"

end switch

unlock screen

set the cursor to empty

end ShowFile

------------------------------------

function WhichFileType pFile

put Extension(pFile) into tType -- 

switch tType

case "error: could not find extension"

-- on Mac OS we try to get the file type

switch the platform

case "MacOS"

return FileInfo(pFile,"type")

break

-----

default

return "????"

end switch

break

-----

default

return tType

end switch

end WhichFileType

---------------------------------

function WhichDestControl pType

switch

case pType is among the items of kImages -- constant declared at the top of this script

return "image"

break

case pType is among the items of kTexts -- dito

return "field"

break

case (pType is among the items of kSounds) or (pType is among the items of kVideos)

return "player"

break

case pType is among the items of kStacks

return "stack"

break

default

return "????"

end switch

end WhichDestControl

---------------------------------

function Extension pFilePath

local tFileName

-----

set the itemDel to slash

put item -1 of pFilePath into tFileName

if "." is not in tFileName then return "error: could not find extension"

repeat with i = the number of chars of tFileName down to 1

if char i of tFileName = "." then exit repeat

end repeat

if (i+5) < the number of chars of tFileName then return "error: could not find extension"

return char (i+1) to (the number of chars of tFileName) of tFileName

end Extension

---------------------------------

function FileInfo pFile,pInfo

local tDefaultFolder,tFiles,tFilter,tSize,tDate,tType,tCreator

-----

set the itemDel to slash

set the defaultFolder to item 1 to -2 of pFile -- parent folder

put urldecode(the long files) into tFiles

filter tFiles with last item of pFile & "*"

-----

set the itemDel to comma

switch pInfo

case "size"

put item 2 of tFiles + item 3 of tFiles into tSize

put tSize div 1024 into tSize

if tSize > 1000 then

set the numberFormat to "0.0"

put tSize / 1024 && "Mb" into tSize

else put tSize && "Kb" into tSize

return tSize

break

case "creation"

put item 4 of tFiles into tDate

convert tDate from seconds to system date and system time

return tDate

break

case "modification"

put item 5 of tFiles into tDate

convert tDate from seconds to system date and system time

return tDate

break

case "type"

put char -4 to -1 of item 11 of tFiles into tType

if tType = empty then return "????"

else return tType

break

case "creator"

put char -8 to -5 of item 11 of tFiles into tCreator

if tCreator = empty then return "????"

else return tCreator

end switch

end FileInfo

---------------------------------

on CleanStack

put empty into fld "DragData"

put empty into fld "NumOfItems"

set the fileName of player "Test" to empty

set the fileName of img "Test" to empty

ShowFile -- 

save this stack

put "Done"

end CleanStack

@0DIJKOSUWabegjBlackCheckmark.png PNG  IHDR  pHYs  gAMA|Q cHRMz%u0`:o_FxIDATxb` 17 R@L:̤/@,0@1I +x%@LħHW ť$@PIV dĊK806IENDB` cREVGeneral revUniqueID 1109347801497 0 DragData q)on mouseUp ShowFile -- C end mouseUp @X]Click to display the data2Z' cREVGeometryMaster,expectedRect20,206,620,299Master,scalebottomDistance-271Master,movevDistancefalseMaster,scaleBottomObjectSideBottomMaster,movehDistancefalseMaster,scaleBottomscaleBottomtrueMastertrueMaster,scalerightDistanceMaster,scaleBottomObjectRefcardMaster,scaleBottomAbsolutetrueMaster,cardRanking1Master,scaleBottomtrueMaster,scaleleftDistanceMaster,scaletopDistance cREVGeneralscriptChecksum5*M$^]3D/ bookmarks revUniqueID 1109849448492 handlerListmouseUpscriptSelection char 15 to 14 prevHandlerenterKey tempScriptscript

on mouseUp

ShowFile -- C

end mouseUp

 E`[LPaG@ Flche2.png z PNG  IHDR Kpl_ pHYs  gAMA|Q cHRMz%u0`:o_FIDATxb?,Xv$ϯ.?~~e'P#@11 @?~23_k_?V@p /÷>|()%ţ,%-F2\@ *n w JU牓/_ o_ū(II` b`AM]Nk5 _ ,?d+@021~K?@fӬ ~W XXY};w<||| ߿}Kw^W@koǑ74;Gڷo_߿uLL7qe`&Fqϟ_sPuFFfbA8`(10r=zk~ TxNP`=l|,IENDB` cREVGeneral revUniqueID 1109350346443 DDADZone (2o(((( cREVGeneral scriptChecksumُ B~ handlerList breakPointsscriptSelection char 1 to 0 revUniqueID 1110117105542 bookmarks tempScript prevHandler DragDataTypesscript

 Drag and drop hereITypeE)g4File or folder cREVGeneral revUniqueID 1110121621164 JMediaEwYon mouseUp set the itemDel to tab sort fld "Dragdata" by item 2 of each end mouseUp H) File type cREVGeneralscriptChecksumRGǕγ4`ѫ revUniqueID 1110121734336 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 1 to 87script

on mouseUp

set the itemDel to tab

sort fld "Dragdata" by item 2 of each

end mouseUp

K LocationEwYon mouseUp set the itemDel to tab sort fld "Dragdata" by item 4 of each end mouseUp File or folder path cREVGeneralscriptChecksum" A g:2Vv revUniqueID 1110121840757 bookmarks handlerListmouseUp tempScript prevHandlerscriptSelection char 68 to 67script

on mouseUp

set the itemDel to tab

sort fld "Dragdata" by item 4 of each

end mouseUp

ODestEwYon mouseUp set the itemDel to tab sort fld "Dragdata" by item 3 of each end mouseUp p= Destination cREVGeneralscriptChecksumCܖWg[ revUniqueID 1110127981995 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 1 to 87script

on mouseUp

set the itemDel to tab

sort fld "Dragdata" by item 3 of each

end mouseUp

STest`2o cREVGeneral revUniqueID 1110128395730UTest!`2o  cREVGeneralscriptChecksumُ B~ revUniqueID 1110128918199 bookmarks handlerList tempScript prevHandlermouseUpscriptSelection char 1 to 0script

WTest`2 o  cREVGeneral revUniqueID 1110129468932  Claudie Camus-Chatonet @A 24, Boulevard de Port-Royal @A 75005 Paris @A N Socitaire : 1354080N MAIF @A @B 4N sinistre : 7020639812275306 20, rue Corvisart @A @B @A   75013 Paris @A @C  Paris, le 26 aot 2002, @A Messieurs, @A .Suite notre dclaration du 13/08/02, enregistre chez vous sous le numro en rfrence, vous voudrez bien trouver ci-joint dment complt., le constat amiable que vous nous avez fait parvenir. L'adversaire apparat d'ailleurs galement assur chez vous : cela devrait faciliter un rglement rapide. @A- 3 end mouseUp $~Display  cREVGeneralscriptChecksum_@dp6i bookmarks revUniqueID 1110180855803 handlerListmouseUpscriptSelection char 80 to 79 prevHandler tempScriptscript>

on mouseUp

set the enabled of btn "FilesType" to the hilitedButton of me <> 3

end mouseUp

^First Row FileshD$:jDropped files only cREVGeneral revUniqueID 1110180714513  _ All FileshD$Pn/Dropped files and all files in dropped folders cREVGeneral revUniqueID 1110180717157  `FoldershD$gd Folders only cREVGeneral revUniqueID 1110180719182   b Label Field  S cREVGeneral revUniqueID 1110181641740 cPlay with options, drag and drop, display files and have a look to the fully commented handlers...eBottom i2` cREVGeometry Master,expectedRect16,306,624,494Master,scalebottomDistanceMaster,movevDistance-139Master,moveVObjectSidebottomMaster,movehDistancefalseMastertrueMaster,scalerightDistanceMaster,moveVObjectRefcardMaster,moveVAbsolutetrueMaster,cardRanking1 Master,moveVtrueMaster,scaleleftDistanceMaster,scaletopDistance cREVGeneral revUniqueID 1110184068411 Info pon linkClicked pLink lock screen go stack "revDocs" if revAppVersion() = 2.5 then put pLink into fld "Find" set the menuhistory of btn "Filter type" to 1 send "mouseUp" to btn "Go" end if end linkClicked \X cREVGeneralscriptChecksumb|"A"S revUniqueID 1109350253372 bookmarks handlerList linkClicked tempScript prevHandler linkClickedscriptSelectionchar 102 to 101script

on linkClicked pLink

lock screen

go stack "revDocs"

if revAppVersion() = 2.5 then

put pLink into fld "Find"

set the menuhistory of btn "Filter type" to 1

send "mouseUp" to btn "Go"

end if

end linkClicked

 #How-To stack #010 by Eric Chatonet " 3/7/05 Initial release   45/27/05 Modified for Tutorial Picker compatibility @ @, This stack shows how to manage files or folders drag and drop, how to retrieve the right kind of data and how to display it into a field, an image or a player (Quicktime must be installed). @ Enjoy! @ In order to accept drag and drop within any area, you have first to set the acceptDrop property to true for the target in a dragEnter handler: see the scripts and acceptDrop property in the docs. @1600 M N X& ~    When the acceptDrop property of a target is true, a dragDrop message is sent by the engine to this target when the user drops data within the target: see the scripts and dragDrop message in the docs. @1600   ! 6 ?m    Then, by analizing the dragData contents, you will be able to respond properly: see the scripts and dragdata message in the docs. @1600   !E  f n In this stack we just have a look to files and folders drag and drop. In this case, the dragdata contain so many lines as files of folders the user dropped. Each line contains a complete file or folder path. @1600 Y Z bR   You can test if each line of the dragData is a file or a folder according to your needs: see DisplayFirstRowFiles or DisplayFolders handlers in the scripts. @1600 " # +4 _ s w  If it is a file, you can look for what kind of file it is by testing the file extension (and the fileType if needed with Mac OS). See WhichFileType, Extension and FileInfo functions in the scripts. @1600  O  c k       Finally, knowing the kind of the file, you can display it according to what it is: an image, a sound, a movie, HTML text, RTF Text, etc. @1600 i j  - JPEG,jpg,GIFf,gif,PNGf,png,PICT,BMP ,bmp are files type or extensions of image files you will display into an image object:  { @ set the fileName of image "MyImage" to line 1 of the dragData  @blue @  @red  @ $ @red6 > - AIFF,aif,VfW ,avi,M4A ,m4a,mov,MooV,Mp3 ,mp3,WAVE,wav are files type or extensions of sound and movie files you will display into a player object.   B set the fileName of player "MyPlayer" to line 1 of the dragData  @blue @  @red  @ & @red8 @ j - txt,TEXT,rtf,htm,html are files type or extensions of text files you will display into a field object.  f 9 set the text of fld "MyField" to line 1 of the dragData  @blue @  @red  @  " @red0 < set the rtfText of fld "MyField" to line 1 of the dragData  @blue @  @red  @ " @red3 = set the htmlText of fld "MyField" to line 1 of the dragData  @blue @  @red  @ " @red4 aNote that PDF files can be displayed into a player with Mac OS X (not implemented in this demo). ` v Sometimes, you will prefer to get back the file contents into a variable and manage it by using the following form: @1600 e f 6 put url("file:" & line 1 of the dragData) into tData  @blue  @black  @red! @black) +  -- instructions   B `[]SSS.png  Hon mouseDown revGoUrl "http://www.sosmartsoftware.com" end mouseDown  "-PNG  IHDR". pHYs.#.#x?v 9iCCPPhotoshop ICC profilexڝwTTϽwz0z.0. Qf Ml@DEHb!(`HPb0dFJ|yyǽgs{.$O./ 'z8WGбx0Y驾A@$/7z HeOOҬT_lN:K"N3"$F/JPrb[䥟}Qd[Sl1x{#bG\NoX3I[ql2$ 8xtrp/8 pCfq.Knjm͠{r28?.)ɩL^6g,qm"[Z[Z~Q7%" 3R`̊j[~: w!$E}kyhyRm333: }=#vʉe tqX)I)B>== <8Xȉ9yP:8p΍Lg kk Ѐ$t!0V87`ɀ2A. @JPA#h'@8 .: ``a!2D!UH 2 dA>P ECqB**Z:]B=h~L2  5pN:|ó@ QC !H,G6 H9R ]H/r Aw( Q(OTJCm@*QGQ-(j MF+ 6h/*t:].G7Зw7 Xa<1:L1s3bXyeb~19 vGĩp+5qy^ oó|= ?'Htv`Ba3BDxHxE$Չ"XAP44077&9$An0;T2421t.54ld+s;# V]=iY9FgM֚k&=%Ō:nc1gcbcfX.}lGv{c)LŖN퉛w/p+/<j$.$%&㒣OdxTԂԑ4i3|o~C:&S@L u[Uo3C3OfIgwdO|;W-wsz 17jl8c͉̈́3+{%lKWr[ $ llGmnacOkE&EEY׾2⫅;K,KhtiN=e²{^-_V^Oo§s]?TWީrjVQ=w}`嚢zԶiו8>k׍ E  [ly邟~_Y53rW򯎼^{7so}x>|쇊z>yzgAMA|Q cH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~1?@KOa}`~H/7737?>o(2A_?{u'>7 `==Wpi}dϧ'v.Ⱦ2Y^<ӇXyy~~{'6~u+h ë >q^!eV w2{*wξ ?pf/+po?>+a%,-G!xs{ UziN:Lȉj?bFbFZ`X!C_5 lfUHv#H{ y*ϊa-Xc \|(:mJ[}pwwK\ӻ^7#`@jE f{&0HaOeR^b:"8r G#Rτ%P>-Z[XhWCC VAGL[X _DGY36ؘs`AX@z?6e_4B+LI=88hY X"=G1"978H3X˄ ۦ { nfh !l8t~C)yyޞoՙoo-Hu,k-Te5ʈfFK\{Hpehu?" GDÆGZK'h?D⡕B>,,7ug'H= `ı} /Q@60,lk1'!l"F?M!H \2nha?h"?͈+#Ă'?[BX?Z'$V} e@)ii@:TZVJ@, \͌o'zM[{@D}3<bhT``4Ӥ(IENDB` cREVGeneralscriptChecksum`}^.e bookmarks revUniqueID 1109350299073 handlerList mouseDownscriptSelection char 13 to 12 prevHandler tempScriptscript

on mouseDown

revGoUrl "http://www.sosmartsoftware.com"

end mouseDown

dShow HandlersEp5on mouseUp edit the script of this cd end mouseUp 6d cREVGeneralscriptChecksumLfB+s revUniqueID 1110181903137 bookmarks handlerListmouseUp tempScript prevHandlerscriptSelection char 40 to 39script

on mouseUp

edit the script of this cd

end mouseUp

 g NumOfItems  cREVGeneral revUniqueID 1110193727358 j FilesType e%{ All Types9All Types Text Files Image Files Sound Files Video Files cREVGeneral revUniqueID 1110210978580