Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

Thread: [DHTML] ActiveX Simplified

  1. #1
    Join Date
    Aug 2006
    Posts
    30
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Smile [DHTML] ActiveX Simplified

    1) CODE TITLE: ActiveX Simplified

    2) AUTHOR NAME/NOTES:
    Created by Gavin Delphia © 2007
    All Rights Reserved

    3) DESCRIPTION:

    This script consitst of ActiveX functions that are accessed through javascript such as read and writting to files. Moving, copying, deleting, finding attributes of files. It can also list all files in a folder, get the computer user name, domain name, and computer name. Supports ascii to binary conversion and the reverse. It also has a function to launch any application found on a computer.

    This library only works with internet Explorer and it is intended for use with Microsoft Hypertext Application or .hta
    Errors and limited functionality may occur if used in a .html or .htm

    [Call Format:] $funcname(target,parameters)

    Every function either returns True, False, or the Requested Data.
    For query functions such as does a $FileExist() and $FolderExist() true and false represent yes and no respectively.
    The $OpenFile() function returns the documents contents if true or false if a error occurs.
    All other functions return True for action executed or false for action failed.

    $OpenFile(file) -
    opens file and returns text

    $GetFolderFiles(folder) -
    Returns array of files in target folder

    $GetFileBaseName(file) -
    Returns just the name of the file without the path or file extension

    $GetFileExtension(file) -
    Returns just the file extension without the path or name

    $GetFileName(file) -
    Returns the file name followed by the extension. No path

    $GetParentFolder(file) -
    Returns the parent folder of any file or folder

    $CreateFile(file,datatowrite) -
    Creates a file with specified data

    $CreateFolder(folder) -
    Creates a folder

    $DeleteFile(file) -
    Deletes File

    $DeleteFolder(folder) -
    Delets Folder

    $FileExist(file) -
    Returns true if file exists and false if it does not

    $FolderExist(folder) -
    Returns true if folder exists and false if it does not

    $CopyFile(file,destionation) -
    Copies file to the destionation

    $CopyFolder(folder,destination) -
    Copies folder to the destination

    $MoveFile(file,destination) -
    Deletes file from original location and moves to destination

    $MoveFolder(folder,destination) -
    Deletes folder from original location and moves to destination

    $GetComputerName() -
    Returns the name of the computer

    $GetUserName() -
    Returns the name of the user

    $GetUserDomain() -
    Returns the domain of the user

    $LaunchApp(target_app) -
    Launches the specified application. Eg $LaunchApp('cmd.exe')

    $ToBinary(string) -
    Returns string converted to binary

    $ToAscii(string) -
    Returns string converted to ascii



    4) URL TO CODE:

    or, ATTACHED BELOW (see #3 in guidelines below):

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The $ character should be reserved for machine-generated identifiers.

    This library would be much more useful if it were coupled with a Java applet rather than using ActiveX. That would extend its use considerably.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2006
    Posts
    30
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Why not Java

    The point of this library is to add the advantage of modifying files using javascript. It is intended to be used with the .hta file format which is a format used for developing applications with Javascript. Why use java which requires SDK's, runtimes and compilers and why create something that already exists in Java. The Javascript method to access files other than Ajax is complicated and not readily available in fear of Script Kiddies gaining the power to access the file system. This script is designed for people interested in making client side applications with Javascript not Java.

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Well, that sounds great and all.
    But I'm using firefox. And so is basically everyone else here (or at least another browser than IE).
    On the web, the stats are more toward IE, perhaps 60% IE - 40% not, but that is still a large user base who would have no access.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I think you've misunderstood me.
    It is intended to be used with the .hta file format which is a format used for developing applications with Javascript.
    I know what HTA is (and it's a terrible idea, Javascript is really not suited to this kind of application development, as a friend of mine who's spent several months trying to develop a usable set of Windows-style widgets will tell you). I was suggesting that with the addition of an applet this could be made to actually work cross-browser and cross-platform as well.
    Why use java which requires SDK's, runtimes and compilers and why create something that already exists in Java.
    Well, ActiveX requires Windows and IE. What's your point? What would be created would effectively be bindings to the Java applet; it wouldn't be necessary to recreate the functionality within Java.
    The Javascript method to access files other than Ajax is complicated and not readily available in fear of Script Kiddies gaining the power to access the file system.
    There is no Javascript method to access files (so far; Mozilla are working on it). What you're talking about is ActiveX, which is not Javascript. It's an entirely separate technology to which Microsoft has provided bindings -- much in the way I was suggesting providing bindings to Java, which would be more useful.
    This script is designed for people interested in making client side applications with Javascript not Java.
    Thus, the bindings. The user would not have to touch Java.

    djr33, you're missing the point as well. The original script was designed for use with HTAs, which are an IE-only technology (and will run in IE no matter what browser you might use for surfing the Web, at least on Windows). In this capacity, it does work; I just think that that capacity is rather more limited than it need be.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'm on a mac. And you're on Linux.
    I have XP as well, but I dislike using IE, so why would I want to have a 'good' addition to this program?

    Just because someone writes a great macro for word, that doesn't mean it's a good editor for webpages
    (This is a metaphor, btw.... just in case someone doesn't catch that.)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Aug 2006
    Posts
    30
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Thanks

    Thanks guys for the comments. I hope the script will be useful to someone.

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I'm on a mac. And you're on Linux.
    I have XP as well, but I dislike using IE, so why would I want to have a 'good' addition to this program?
    Thus, why I thought the capacity was overly limited. Using a Java applet it would no longer be IE- or Windows-specific.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I hope it's useful to someone too. Remember, the problem is with ActiveX in the first place, not your coding. Your code seems to be quite well thought out and usable, but it is just limited by the limits of the system.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,475
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    pcbuster would love this!
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •