Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Clear all editable fields
Drag Install
Creating an object that simulates an array
Director 8.5 Studio
Windows Sounds Scheme Customization
Tygtris
cXtraDialogs
Importing bitmaps without loosing white space
Scroll Thumb Track
Macromedia Director 7: Creating Powerful Multimedia
MediaMacros Xtras Mall
 

 

 

Behavior Create a Shortcut on desktop

Added on 6/12/2000

 

Compatibilities:
behavior D7 D8 PC

Required Xtras:
Buddy API

This item has not yet been rated

Author: KumarK

Create a Shortcut on desktop

---- written for Director 8 ---
---- Kumar.K kumark@icode.com ----

-- custom properties --
property folderlist,theFile,subfolders,fileslist,whereto,programname

------ Get Behavior Description List ------
on getPropertyDescriptionList me
  fileslist=getfilelist(me)
  set description = [:]
  addProp description, #theFile, [#format:#String, #comment: "Select the file You want add to windsows Desktop ?", #range:fileslist,#default:fileslist[1]]
  addProp description, #programname, [#format:#String, #comment: "Enter the ShortCut Name", #default:"Enter the name here"]
  if the currentspritenum = 0 then
    addProp description, #WhereTo, [#comment: "Where To Attach ?" ,#format:#String,
    #range:["On EnterFrame","On ExitFrame"],#default:"On EnterFrame"]
  else
    addProp description, #WhereTo, [#comment: "Where To Attach ?" ,#format:#String,
    #range:["On MouseUp","On MouseDown","On MouseEnter","On MouseLeave"],#default:"On MouseUp"]    
  end if    
  return description
end getPropertyDescriptionList
------ Get Behavior Description List ------

-- Get Behavior description --
on getBehaviorDescription
  return "This Behavior adds the specified file of the current directory or " & RETURN &
"the subfolder(upto level 2) to windows Desktop." & RETURN & RETURN &
  "This Behavior needs Buddy API Xtra to work, so please ensure You Have Buddy API Xtra." & RETURN & RETURN &
  "Parameters" & RETURN &
  "* File." & RETURN &
  "* Program Name." & RETURN &
  "* Where to attach this Script"
end
-- Get Behavior description --

---- get the file name to be opened ----
on getfilelist me
  set mypath=the moviepath
  set fileslist=[]
  set Folders = baFolderList( mypath )
  set Files = baFileList( mypath ,"*.*")
  repeat with M=1 to Files.count
    fileslist.append(files[m])
  end repeat
  repeat with i = 1 to folders.count
    set subfolders = baFolderList( mypath & "" & folders[i])
    if subfolders.count <> 0 then
      repeat with j=1 to subfolders.count
        set Files = baFileList( mypath & " " &  folders[i] & "" & subfolders[j],"*.*")
        repeat with k=1 to Files.count
          fileslist.append(folders[i] & "" & subfolders[j] & "" & files[k])
        end repeat
      end repeat
      set Files = baFileList( mypath & " " &  folders[i],"*.*")    
      repeat with j=1 to Files.count
        fileslist.append(folders[i] & "" & files[j])
      end repeat    
    else
      set Files = baFileList( mypath & " " &  folders[i],"*.*")
      repeat with j=1 to Files.count
        fileslist.append(folders[i] & "" & files[j])
      end repeat
    end if      
  end repeat
  return fileslist
end
---- get the file name to be opened ----

-- Events --
on EnterFrame me
  if WhereTo = "On EnterFrame" then
    addthefile
  end if
end EnterFrame

on ExitFrame me
  if WhereTo = "On EnterFrame" then
    addthefile
  end if
end ExitFrame

on MouseUp
  if WhereTo = "On MouseUp" then
    addthefile
  end if
end MouseUp

on MouseDown
  if WhereTo = "On MouseDown" then
    addthefile
  end if
end MouseDown`

on MouseEnter
  if WhereTo = "On MouseEnter" then
    addthefile
  end if
end MouseEnter

on MouseLeave
  if WhereTo = "On MouseLeave" then
    addthefile
  end if
end MouseLeave
------ Events ------

---add file ---
on addthefile
set OK = baMakeShortcut( the moviepath & thefile , baSysFolder( "Desktop" ),programname )
end
---add file ---

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail