Sign in to follow this  
Followers 0
rolok

_Clipboard and format "Mac-XMSC"

3 posts in this topic

I'm trying to get data from the clipboard. The data I'm trying to get is a script from FileMaker. It is text in an xml format, so nothing crazy. They register their clipboard format as "Mac-XMSC". However, everything that I have tried to get that data off of the clipboard has failed.

I have modified one of the help files to provide more information about the format:

#include <GuiConstantsEx.au3>
#include <ClipBoard.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Global $iMemo

_Main()

Func _Main()
    Local $hGUI, $iFormat, $iCount

    ; Create GUI
    $hGUI = GUICreate("Clipboard", 600, 400)
    $iMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
    GUISetState()

    ; Open the clipboard
    If Not _ClipBoard_Open ($hGUI) Then _WinAPI_ShowError ("_ClipBoard_Open failed")

    ; Show clipboard formats available
    MemoWrite("Clipboard formats ..: " & _ClipBoard_CountFormats ())

    ; Enumerate clipboard formats
    Do
        $iFormat = _ClipBoard_EnumFormats ($iFormat)
        If $iFormat <> 0 Then
            $iCount += 1
            MemoWrite("Clipboard format " & $iCount & " .: " & _ClipBoard_FormatStr ($iFormat))
            MemoWrite("Format Available .: " & _ClipBoard_IsFormatAvailable($iFormat))
            MemoWrite("iFormat .: " & $iFormat)
            MemoWrite(_ClipBoard_GetData ($iFormat))
        EndIf
    Until $iFormat = 0

    ; Close the clipboard
    _ClipBoard_Close ()

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

EndFunc   ;==>_Main

; Write message to memo
Func MemoWrite($sMessage = "")
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite

Below is the output from that code when I have copied the data onto the clipboard from the FileMaker application.

Clipboard formats ..: 1

Clipboard format 1 .: Mac-XMSC

Format Available .: True

iFormat .: 49570

0

I have tried using the _ClipBoard_GetDataEx as per the examples as well, and just can't get it going. I feel like it should be very doable since there are a couple of applications out there that can do it, and it seems like everything is in place in AutoIt to provide the functionality.

I've spent a lot of time on this so far to no avail and have been very hesitant to post here on the forums since in order to be able to test, you need to have that data on your clipboard so it seems tough to provide good feedback on my problem. :)

Any and all feedback is appreciated. Thanks!

Share this post


Link to post
Share on other sites



Here is an example of the clipboard contents (pulled using clipx.exe)

C1A2 - Mac-XMSC  (49570)
Size=4573
00000000: D9 11 00 00 3C 64 75 6D 6D 79 3E 0A 09 3C 53 63   Ù___<dummy>__<Sc
00000010: 72 69 70 74 20 69 64 3D 22 31 22 20 6E 61 6D 65   ript id="1" name
00000020: 3D 22 4F 6E 4F 70 65 6E 69 6E 67 22 20 69 6E 63   ="OnOpening" inc
00000030: 6C 75 64 65 49 6E 4D 65 6E 75 3D 22 46 61 6C 73   ludeInMenu="Fals
00000040: 65 22 20 72 75 6E 46 75 6C 6C 41 63 63 65 73 73   e" runFullAccess
00000050: 3D 22 54 72 75 65 22 3E 0A 09 09 3C 53 74 65 70   ="True">___<Step
00000060: 20 69 64 3D 22 36 38 22 20 6E 61 6D 65 3D 22 49    id="68" name="I
00000070: 66 22 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22   f" enable="True"
00000080: 3E 0A 09 09 09 3C 43 61 6C 63 75 6C 61 74 69 6F   >____<Calculatio
00000090: 6E 3E 0A 09 09 09 09 3C 21 5B 43 44 41 54 41 5B   n>_____<![CDATA[
000000A0: 4D 65 6E 75 5F 62 79 5F 43 6F 6E 73 74 61 6E 74   Menu_by_Constant
000000B0: 3A 3A 67 4C 6F 67 69 6E 55 73 65 64 5F 46 6C 61   ::gLoginUsed_Fla
000000C0: 67 20 3D 20 31 5D 5D 3E 0A 09 09 09 3C 2F 43 61   g = 1]]>____</Ca
000000D0: 6C 63 75 6C 61 74 69 6F 6E 3E 0A 09 09 3C 2F 53   lculation>___</S
000000E0: 74 65 70 3E 0A 09 09 3C 53 74 65 70 20 69 64 3D   tep>___<Step id=
000000F0: 22 31 22 20 6E 61 6D 65 3D 22 50 65 72 66 6F 72   "1" name="Perfor
00000100: 6D 20 53 63 72 69 70 74 22 20 65 6E 61 62 6C 65   m Script" enable
00000110: 3D 22 54 72 75 65 22 3E 0A 09 09 09 3C 43 75 72   ="True">____<Cur
00000120: 72 65 6E 74 53 63 72 69 70 74 20 76 61 6C 75 65   rentScript value
00000130: 3D 22 50 61 75 73 65 22 2F 3E 0A 09 09 09 3C 53   ="Pause"/>____<S
00000140: 63 72 69 70 74 20 69 64 3D 22 33 32 38 36 30 22   cript id="32860"
00000150: 20 6E 61 6D 65 3D 22 55 73 65 72 5F 41 62 6F 72    name="User_Abor
00000160: 74 22 2F 3E 0A 09 09 3C 2F 53 74 65 70 3E 0A 09   t"/>___</Step>__
00000170: 09 3C 53 74 65 70 20 69 64 3D 22 38 36 22 20 6E   _<Step id="86" n
00000180: 61 6D 65 3D 22 53 65 74 20 45 72 72 6F 72 20 43   ame="Set Error C
00000190: 61 70 74 75 72 65 22 20 65 6E 61 62 6C 65 3D 22   apture" enable="
000001A0: 54 72 75 65 22 3E 0A 09 09 09 3C 53 65 74 20 73   True">____<Set s
000001B0: 74 61 74 65 3D 22 54 72 75 65 22 2F 3E 0A 09 09   tate="True"/>___
000001C0: 3C 2F 53 74 65 70 3E 0A 09 09 3C 53 74 65 70 20   </Step>___<Step 
000001D0: 69 64 3D 22 35 35 22 20 6E 61 6D 65 3D 22 45 6E   id="55" name="En
000001E0: 74 65 72 20 42 72 6F 77 73 65 20 4D 6F 64 65 22   ter Browse Mode"
000001F0: 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22 3E 0A    enable="True">_
00000200: 09 09 09 3C 50 61 75 73 65 20 73 74 61 74 65 3D   ___<Pause state=
00000210: 22 46 61 6C 73 65 22 2F 3E 0A 09 09 3C 2F 53 74   "False"/>___</St
00000220: 65 70 3E 0A 09 09 3C 53 74 65 70 20 69 64 3D 22   ep>___<Step id="
00000230: 31 22 20 6E 61 6D 65 3D 22 50 65 72 66 6F 72 6D   1" name="Perform
00000240: 20 53 63 72 69 70 74 22 20 65 6E 61 62 6C 65 3D    Script" enable=
00000250: 22 54 72 75 65 22 3E 0A 09 09 09 3C 43 75 72 72   "True">____<Curr
00000260: 65 6E 74 53 63 72 69 70 74 20 76 61 6C 75 65 3D   entScript value=
00000270: 22 50 61 75 73 65 22 2F 3E 0A 09 09 09 3C 53 63   "Pause"/>____<Sc
00000280: 72 69 70 74 20 69 64 3D 22 33 32 38 34 38 22 20   ript id="32848" 
00000290: 6E 61 6D 65 3D 22 4F 70 65 6E 5F 43 68 65 63 6B   name="Open_Check
000002A0: 46 6F 72 44 75 70 46 69 6C 65 22 2F 3E 0A 09 09   ForDupFile"/>___
000002B0: 3C 2F 53 74 65 70 3E 0A 09 09 3C 53 74 65 70 20   </Step>___<Step 
000002C0: 69 64 3D 22 32 33 22 20 6E 61 6D 65 3D 22 53 68   id="23" name="Sh
000002D0: 6F 77 20 41 6C 6C 20 52 65 63 6F 72 64 73 22 20   ow All Records" 
000002E0: 65 6E 61 62 6C 65 3D 22 54 72 75 65 22 2F 3E 0A   enable="True"/>_
000002F0: 09 09 3C 53 74 65 70 20 69 64 3D 22 36 22 20 6E   __<Step id="6" n
00000300: 61 6D 65 3D 22 47 6F 20 74 6F 20 4C 61 79 6F 75   ame="Go to Layou
00000310: 74 22 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22   t" enable="True"
00000320: 3E 0A 09 09 09 3C 4C 61 79 6F 75 74 44 65 73 74   >____<LayoutDest
00000330: 69 6E 61 74 69 6F 6E 20 76 61 6C 75 65 3D 22 53   ination value="S
00000340: 65 6C 65 63 74 65 64 4C 61 79 6F 75 74 22 2F 3E   electedLayout"/>
00000350: 0A 09 09 09 3C 4C 61 79 6F 75 74 20 69 64 3D 22   ____<Layout id="
00000360: 38 22 20 6E 61 6D 65 3D 22 42 6C 61 6E 6B 22 2F   8" name="Blank"/
00000370: 3E 0A 09 09 3C 2F 53 74 65 70 3E 0A 09 09 3C 53   >___</Step>___<S
00000380: 74 65 70 20 69 64 3D 22 37 36 22 20 6E 61 6D 65   tep id="76" name
00000390: 3D 22 53 65 74 20 46 69 65 6C 64 22 20 65 6E 61   ="Set Field" ena
000003A0: 62 6C 65 3D 22 54 72 75 65 22 3E 0A 09 09 09 3C   ble="True">____<
000003B0: 43 61 6C 63 75 6C 61 74 69 6F 6E 3E 0A 09 09 09   Calculation>____
000003C0: 09 3C 21 5B 43 44 41 54 41 5B 4D 65 6E 75 5F 62   _<![CDATA[Menu_b
000003D0: 79 5F 43 6F 6E 73 74 61 6E 74 3A 3A 67 50 72 65   y_Constant::gPre
000003E0: 66 73 55 73 65 72 4E 61 6D 65 5D 5D 3E 0A 09 09   fsUserName]]>___
000003F0: 09 3C 2F 43 61 6C 63 75 6C 61 74 69 6F 6E 3E 0A   _</Calculation>_
00000400: 09 09 09 3C 46 69 65 6C 64 20 69 64 3D 22 31 31   ___<Field id="11
00000410: 34 22 20 6E 61 6D 65 3D 22 67 43 75 72 72 55 73   4" name="gCurrUs
00000420: 65 72 22 20 74 61 62 6C 65 3D 22 58 44 43 5F 4D   er" table="XDC_M
00000430: 61 73 73 41 74 74 72 69 62 75 74 65 50 72 6F 64   assAttributeProd
00000440: 75 63 74 22 2F 3E 0A 09 09 3C 2F 53 74 65 70 3E   uct"/>___</Step>
00000450: 0A 09 09 3C 53 74 65 70 20 69 64 3D 22 36 38 22   ___<Step id="68"
00000460: 20 6E 61 6D 65 3D 22 49 66 22 20 65 6E 61 62 6C    name="If" enabl
00000470: 65 3D 22 54 72 75 65 22 3E 0A 09 09 09 3C 43 61   e="True">____<Ca
00000480: 6C 63 75 6C 61 74 69 6F 6E 3E 0A 09 09 09 09 3C   lculation>_____<
00000490: 21 5B 43 44 41 54 41 5B 50 61 74 74 65 72 6E 43   ![CDATA[PatternC
000004A0: 6F 75 6E 74 28 4D 65 6E 75 5F 62 79 5F 43 6F 6E   ount(Menu_by_Con
000004B0: 73 74 61 6E 74 3A 3A 67 50 72 65 66 73 5F 53 65   stant::gPrefs_Se
000004C0: 63 75 72 69 74 79 5F 47 65 6E 65 72 61 6C 41 63   curity_GeneralAc
000004D0: 63 65 73 73 3B 20 22 44 65 76 65 6C 6F 70 65 72   cess; "Developer
000004E0: 22 29 20 3D 20 31 5D 5D 3E 0A 09 09 09 3C 2F 43   ") = 1]]>____</C
000004F0: 61 6C 63 75 6C 61 74 69 6F 6E 3E 0A 09 09 3C 2F   alculation>___</
00000500: 53 74 65 70 3E 0A 09 09 3C 53 74 65 70 20 69 64   Step>___<Step id
00000510: 3D 22 32 39 22 20 6E 61 6D 65 3D 22 53 68 6F 77   ="29" name="Show
00000520: 2F 48 69 64 65 20 53 74 61 74 75 73 20 41 72 65   /Hide Status Are
00000530: 61 22 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22   a" enable="True"
00000540: 3E 0A 09 09 09 3C 4C 6F 63 6B 20 73 74 61 74 65   >____<Lock state
00000550: 3D 22 46 61 6C 73 65 22 2F 3E 0A 09 09 09 3C 53   ="False"/>____<S
00000560: 68 6F 77 48 69 64 65 20 76 61 6C 75 65 3D 22 48   howHide value="H
00000570: 69 64 65 22 2F 3E 0A 09 09 3C 2F 53 74 65 70 3E   ide"/>___</Step>
00000580: 0A 09 09 3C 53 74 65 70 20 69 64 3D 22 36 39 22   ___<Step id="69"
00000590: 20 6E 61 6D 65 3D 22 45 6C 73 65 22 20 65 6E 61    name="Else" ena
000005A0: 62 6C 65 3D 22 54 72 75 65 22 2F 3E 0A 09 09 3C   ble="True"/>___<
000005B0: 53 74 65 70 20 69 64 3D 22 32 39 22 20 6E 61 6D   Step id="29" nam
000005C0: 65 3D 22 53 68 6F 77 2F 48 69 64 65 20 53 74 61   e="Show/Hide Sta
000005D0: 74 75 73 20 41 72 65 61 22 20 65 6E 61 62 6C 65   tus Area" enable
000005E0: 3D 22 54 72 75 65 22 3E 0A 09 09 09 3C 4C 6F 63   ="True">____<Loc
000005F0: 6B 20 73 74 61 74 65 3D 22 54 72 75 65 22 2F 3E   k state="True"/>
00000600: 0A 09 09 09 3C 53 68 6F 77 48 69 64 65 20 76 61   ____<ShowHide va
00000610: 6C 75 65 3D 22 48 69 64 65 22 2F 3E 0A 09 09 3C   lue="Hide"/>___<
00000620: 2F 53 74 65 70 3E 0A 09 09 3C 53 74 65 70 20 69   /Step>___<Step i
00000630: 64 3D 22 37 30 22 20 6E 61 6D 65 3D 22 45 6E 64   d="70" name="End
00000640: 20 49 66 22 20 65 6E 61 62 6C 65 3D 22 54 72 75    If" enable="Tru
00000650: 65 22 2F 3E 0A 09 09 3C 53 74 65 70 20 69 64 3D   e"/>___<Step id=
00000660: 22 36 39 22 20 6E 61 6D 65 3D 22 45 6C 73 65 22   "69" name="Else"
00000670: 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22 2F 3E    enable="True"/>
00000680: 0A 09 09 3C 53 74 65 70 20 69 64 3D 22 36 38 22   ___<Step id="68"
00000690: 20 6E 61 6D 65 3D 22 49 66 22 20 65 6E 61 62 6C    name="If" enabl
000006A0: 65 3D 22 54 72 75 65 22 3E 0A 09 09 09 3C 43 61   e="True">____<Ca
000006B0: 6C 63 75 6C 61 74 69 6F 6E 3E 0A 09 09 09 09 3C   lculation>_____<
000006C0: 21 5B 43 44 41 54 41 5B 47 65 74 28 41 63 74 69   ![CDATA[Get(Acti
000006D0: 76 65 4D 6F 64 69 66 69 65 72 4B 65 79 73 29 20   veModifierKeys) 
000006E0: 3D 20 34 5D 5D 3E 0A 09 09 09 3C 2F 43 61 6C 63   = 4]]>____</Calc
000006F0: 75 6C 61 74 69 6F 6E 3E 0A 09 09 3C 2F 53 74 65   ulation>___</Ste
00000700: 70 3E 0A 09 09 3C 53 74 65 70 20 69 64 3D 22 39   p>___<Step id="9
00000710: 30 22 20 6E 61 6D 65 3D 22 48 61 6C 74 20 53 63   0" name="Halt Sc
00000720: 72 69 70 74 22 20 65 6E 61 62 6C 65 3D 22 54 72   ript" enable="Tr
00000730: 75 65 22 2F 3E 0A 09 09 3C 53 74 65 70 20 69 64   ue"/>___<Step id
00000740: 3D 22 36 39 22 20 6E 61 6D 65 3D 22 45 6C 73 65   ="69" name="Else
00000750: 22 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22 2F   " enable="True"/
00000760: 3E 0A 09 09 3C 53 74 65 70 20 69 64 3D 22 33 34   >___<Step id="34
00000770: 22 20 6E 61 6D 65 3D 22 43 6C 6F 73 65 20 46 69   " name="Close Fi
00000780: 6C 65 22 20 65 6E 61 62 6C 65 3D 22 54 72 75 65   le" enable="True
00000790: 22 3E 0A 09 09 09 3C 46 69 6C 65 52 65 66 65 72   ">____<FileRefer
000007A0: 65 6E 63 65 20 69 64 3D 22 33 32 22 20 6E 61 6D   ence id="32" nam
000007B0: 65 3D 22 4D 65 6E 75 22 20 70 61 74 68 4C 69 73   e="Menu" pathLis
000007C0: 74 3D 22 66 69 6C 65 3A 42 44 43 5F 4D 65 6E 75   t="file:BDC_Menu
000007D0: 22 2F 3E 0A 09 09 3C 2F 53 74 65 70 3E 0A 09 09   "/>___</Step>___
000007E0: 3C 53 74 65 70 20 69 64 3D 22 33 34 22 20 6E 61   <Step id="34" na
000007F0: 6D 65 3D 22 43 6C 6F 73 65 20 46 69 6C 65 22 20   me="Close File" 
00000800: 65 6E 61 62 6C 65 3D 22 54 72 75 65 22 2F 3E 0A   enable="True"/>_
00000810: 09 09 3C 53 74 65 70 20 69 64 3D 22 34 34 22 20   __<Step id="44" 
00000820: 6E 61 6D 65 3D 22 45 78 69 74 20 41 70 70 6C 69   name="Exit Appli
00000830: 63 61 74 69 6F 6E 22 20 65 6E 61 62 6C 65 3D 22   cation" enable="
00000840: 54 72 75 65 22 2F 3E 0A 09 09 3C 53 74 65 70 20   True"/>___<Step 
00000850: 69 64 3D 22 37 30 22 20 6E 61 6D 65 3D 22 45 6E   id="70" name="En
00000860: 64 20 49 66 22 20 65 6E 61 62 6C 65 3D 22 54 72   d If" enable="Tr
00000870: 75 65 22 2F 3E 0A 09 09 3C 53 74 65 70 20 69 64   ue"/>___<Step id
00000880: 3D 22 37 30 22 20 6E 61 6D 65 3D 22 45 6E 64 20   ="70" name="End 
00000890: 49 66 22 20 65 6E 61 62 6C 65 3D 22 54 72 75 65   If" enable="True
000008A0: 22 2F 3E 0A 09 09 3C 53 74 65 70 20 69 64 3D 22   "/>___<Step id="
000008B0: 31 22 20 6E 61 6D 65 3D 22 50 65 72 66 6F 72 6D   1" name="Perform
000008C0: 20 53 63 72 69 70 74 22 20 65 6E 61 62 6C 65 3D    Script" enable=
000008D0: 22 54 72 75 65 22 3E 0A 09 09 09 3C 43 75 72 72   "True">____<Curr
000008E0: 65 6E 74 53 63 72 69 70 74 20 76 61 6C 75 65 3D   entScript value=
000008F0: 22 50 61 75 73 65 22 2F 3E 0A 09 09 09 3C 53 63   "Pause"/>____<Sc
00000900: 72 69 70 74 20 69 64 3D 22 31 32 30 22 20 6E 61   ript id="120" na
00000910: 6D 65 3D 22 53 6F 72 74 5F 43 6C 65 61 72 47 6C   me="Sort_ClearGl
00000920: 6F 62 61 6C 73 5F 4C 69 73 74 22 2F 3E 0A 09 09   obals_List"/>___
00000930: 3C 2F 53 74 65 70 3E 0A 09 09 3C 53 74 65 70 20   </Step>___<Step 
00000940: 69 64 3D 22 31 22 20 6E 61 6D 65 3D 22 50 65 72   id="1" name="Per
00000950: 66 6F 72 6D 20 53 63 72 69 70 74 22 20 65 6E 61   form Script" ena
00000960: 62 6C 65 3D 22 54 72 75 65 22 3E 0A 09 09 09 3C   ble="True">____<
00000970: 43 75 72 72 65 6E 74 53 63 72 69 70 74 20 76 61   CurrentScript va
00000980: 6C 75 65 3D 22 50 61 75 73 65 22 2F 3E 0A 09 09   lue="Pause"/>___
00000990: 09 3C 53 63 72 69 70 74 20 69 64 3D 22 33 33 30   _<script id="330
000009A0: 37 31 22 20 6E 61 6D 65 3D 22 42 5F 43 6C 65 61   71" name="B_Clea
000009B0: 72 5F 41 6C 6C 22 2F 3E 0A 09 09 3C 2F 53 74 65   r_All"/>___</Ste
000009C0: 70 3E 0A 09 09 3C 53 74 65 70 20 69 64 3D 22 31   p>___<Step id="1
000009D0: 22 20 6E 61 6D 65 3D 22 50 65 72 66 6F 72 6D 20   " name="Perform 
000009E0: 53 63 72 69 70 74 22 20 65 6E 61 62 6C 65 3D 22   Script" enable="
000009F0: 54 72 75 65 22 3E 0A 09 09 09 3C 43 75 72 72 65   True">____<Curre
00000A00: 6E 74 53 63 72 69 70 74 20 76 61 6C 75 65 3D 22   ntScript value="
00000A10: 50 61 75 73 65 22 2F 3E 0A 09 09 09 3C 53 63 72   Pause"/>____<Scr
00000A20: 69 70 74 20 69 64 3D 22 33 33 30 39 33 22 20 6E   ipt id="33093" n
00000A30: 61 6D 65 3D 22 43 6C 65 61 72 5F 4D 61 73 73 50   ame="Clear_MassP
00000A40: 72 69 63 69 6E 67 5F 47 6C 6F 62 61 6C 73 22 2F   ricing_Globals"/
00000A50: 3E 0A 09 09 3C 2F 53 74 65 70 3E 0A 09 09 3C 53   >___</Step>___<S
00000A60: 74 65 70 20 69 64 3D 22 31 22 20 6E 61 6D 65 3D   tep id="1" name=
00000A70: 22 50 65 72 66 6F 72 6D 20 53 63 72 69 70 74 22   "Perform Script"
00000A80: 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22 3E 0A    enable="True">_
00000A90: 09 09 09 3C 43 75 72 72 65 6E 74 53 63 72 69 70   ___<CurrentScrip
00000AA0: 74 20 76 61 6C 75 65 3D 22 50 61 75 73 65 22 2F   t value="Pause"/
00000AB0: 3E 0A 09 09 09 3C 53 63 72 69 70 74 20 69 64 3D   >____<script id=
00000AC0: 22 33 33 32 35 32 22 20 6E 61 6D 65 3D 22 5F 63   "33252" name="_c
00000AD0: 6C 65 61 72 5F 4D 61 73 73 41 74 74 72 5F 63 72   lear_MassAttr_cr
00000AE0: 65 61 74 69 6F 6E 5F 67 6C 6F 62 61 6C 73 22 2F   eation_globals"/
00000AF0: 3E 0A 09 09 3C 2F 53 74 65 70 3E 0A 09 09 3C 53   >___</Step>___<S
00000B00: 74 65 70 20 69 64 3D 22 31 22 20 6E 61 6D 65 3D   tep id="1" name=
00000B10: 22 50 65 72 66 6F 72 6D 20 53 63 72 69 70 74 22   "Perform Script"
00000B20: 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22 3E 0A    enable="True">_
00000B30: 09 09 09 3C 43 75 72 72 65 6E 74 53 63 72 69 70   ___<CurrentScrip
00000B40: 74 20 76 61 6C 75 65 3D 22 50 61 75 73 65 22 2F   t value="Pause"/
00000B50: 3E 0A 09 09 09 3C 53 63 72 69 70 74 20 69 64 3D   >____<script id=
00000B60: 22 33 33 32 36 32 22 20 6E 61 6D 65 3D 22 5F 73   "33262" name="_s
00000B70: 65 74 5F 67 47 72 61 70 68 69 63 5F 4C 61 76 65   et_gGraphic_Lave
00000B80: 6E 64 65 72 22 2F 3E 0A 09 09 3C 2F 53 74 65 70   nder"/>___</Step
00000B90: 3E 0A 09 09 3C 53 74 65 70 20 69 64 3D 22 38 39   >___<Step id="89
00000BA0: 22 20 6E 61 6D 65 3D 22 43 6F 6D 6D 65 6E 74 22   " name="Comment"
00000BB0: 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22 3E 0A    enable="True">_
00000BC0: 09 09 09 3C 54 65 78 74 3E 6D 61 6B 65 20 73 75   ___<Text>make su
00000BD0: 72 65 20 74 68 65 72 65 20 69 73 20 61 74 20 6C   re there is at l
00000BE0: 65 61 73 74 20 6F 6E 65 20 72 65 63 6F 72 64 3C   east one record<
00000BF0: 2F 54 65 78 74 3E 0A 09 09 3C 2F 53 74 65 70 3E   /Text>___</Step>
00000C00: 0A 09 09 3C 53 74 65 70 20 69 64 3D 22 32 33 22   ___<Step id="23"
00000C10: 20 6E 61 6D 65 3D 22 53 68 6F 77 20 41 6C 6C 20    name="Show All 
00000C20: 52 65 63 6F 72 64 73 22 20 65 6E 61 62 6C 65 3D   Records" enable=
00000C30: 22 54 72 75 65 22 2F 3E 0A 09 09 3C 53 74 65 70   "True"/>___<Step
00000C40: 20 69 64 3D 22 36 38 22 20 6E 61 6D 65 3D 22 49    id="68" name="I
00000C50: 66 22 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22   f" enable="True"
00000C60: 3E 0A 09 09 09 3C 43 61 6C 63 75 6C 61 74 69 6F   >____<Calculatio
00000C70: 6E 3E 0A 09 09 09 09 3C 21 5B 43 44 41 54 41 5B   n>_____<![CDATA[
00000C80: 47 65 74 20 28 20 46 6F 75 6E 64 43 6F 75 6E 74   Get ( FoundCount
00000C90: 20 29 3D 30 5D 5D 3E 0A 09 09 09 3C 2F 43 61 6C    )=0]]>____</Cal
00000CA0: 63 75 6C 61 74 69 6F 6E 3E 0A 09 09 3C 2F 53 74   culation>___</St
00000CB0: 65 70 3E 0A 09 09 3C 53 74 65 70 20 69 64 3D 22   ep>___<Step id="
00000CC0: 37 22 20 6E 61 6D 65 3D 22 4E 65 77 20 52 65 63   7" name="New Rec
00000CD0: 6F 72 64 2F 52 65 71 75 65 73 74 22 20 65 6E 61   ord/Request" ena
00000CE0: 62 6C 65 3D 22 54 72 75 65 22 2F 3E 0A 09 09 3C   ble="True"/>___<
00000CF0: 53 74 65 70 20 69 64 3D 22 37 30 22 20 6E 61 6D   Step id="70" nam
00000D00: 65 3D 22 45 6E 64 20 49 66 22 20 65 6E 61 62 6C   e="End If" enabl
00000D10: 65 3D 22 54 72 75 65 22 2F 3E 0A 09 09 3C 53 74   e="True"/>___<St
00000D20: 65 70 20 69 64 3D 22 37 36 22 20 6E 61 6D 65 3D   ep id="76" name=
00000D30: 22 53 65 74 20 46 69 65 6C 64 22 20 65 6E 61 62   "Set Field" enab
00000D40: 6C 65 3D 22 54 72 75 65 22 3E 0A 09 09 09 3C 43   le="True">____<C
00000D50: 61 6C 63 75 6C 61 74 69 6F 6E 3E 0A 09 09 09 09   alculation>_____
00000D60: 3C 21 5B 43 44 41 54 41 5B 22 22 5D 5D 3E 0A 09   <![CDATA[""]]>__
00000D70: 09 09 3C 2F 43 61 6C 63 75 6C 61 74 69 6F 6E 3E   __</Calculation>
00000D80: 0A 09 09 09 3C 46 69 65 6C 64 20 69 64 3D 22 33   ____<Field id="3
00000D90: 32 38 39 31 22 20 6E 61 6D 65 3D 22 67 53 50 5F   2891" name="gSP_
00000DA0: 4F 6E 4F 72 4F 66 66 5F 66 6C 61 67 22 20 74 61   OnOrOff_flag" ta
00000DB0: 62 6C 65 3D 22 58 44 43 5F 4D 61 73 73 41 74 74   ble="XDC_MassAtt
00000DC0: 72 69 62 75 74 65 50 72 6F 64 75 63 74 22 2F 3E   ributeProduct"/>
00000DD0: 0A 09 09 3C 2F 53 74 65 70 3E 0A 09 09 3C 53 74   ___</Step>___<St
00000DE0: 65 70 20 69 64 3D 22 37 36 22 20 6E 61 6D 65 3D   ep id="76" name=
00000DF0: 22 53 65 74 20 46 69 65 6C 64 22 20 65 6E 61 62   "Set Field" enab
00000E00: 6C 65 3D 22 54 72 75 65 22 3E 0A 09 09 09 3C 43   le="True">____<C
00000E10: 61 6C 63 75 6C 61 74 69 6F 6E 3E 0A 09 09 09 09   alculation>_____
00000E20: 3C 21 5B 43 44 41 54 41 5B 22 6F 66 66 22 5D 5D   <![CDATA["off"]]
00000E30: 3E 0A 09 09 09 3C 2F 43 61 6C 63 75 6C 61 74 69   >____</Calculati
00000E40: 6F 6E 3E 0A 09 09 09 3C 46 69 65 6C 64 20 69 64   on>____<Field id
00000E50: 3D 22 33 32 39 36 36 22 20 6E 61 6D 65 3D 22 67   ="32966" name="g
00000E60: 43 45 5F 41 75 74 6F 41 74 74 61 63 68 5F 4F 6E   CE_AutoAttach_On
00000E70: 4F 66 66 22 20 74 61 62 6C 65 3D 22 58 44 43 5F   Off" table="XDC_
00000E80: 4D 61 73 73 41 74 74 72 69 62 75 74 65 50 72 6F   MassAttributePro
00000E90: 64 75 63 74 22 2F 3E 0A 09 09 3C 2F 53 74 65 70   duct"/>___</Step
00000EA0: 3E 0A 09 09 3C 53 74 65 70 20 69 64 3D 22 37 36   >___<Step id="76
00000EB0: 22 20 6E 61 6D 65 3D 22 53 65 74 20 46 69 65 6C   " name="Set Fiel
00000EC0: 64 22 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22   d" enable="True"
00000ED0: 3E 0A 09 09 09 3C 43 61 6C 63 75 6C 61 74 69 6F   >____<Calculatio
00000EE0: 6E 3E 0A 09 09 09 09 3C 21 5B 43 44 41 54 41 5B   n>_____<![CDATA[
00000EF0: 22 4E 6F 77 22 5D 5D 3E 0A 09 09 09 3C 2F 43 61   "Now"]]>____</Ca
00000F00: 6C 63 75 6C 61 74 69 6F 6E 3E 0A 09 09 09 3C 46   lculation>____<F
00000F10: 69 65 6C 64 20 69 64 3D 22 33 33 30 30 35 22 20   ield id="33005" 
00000F20: 6E 61 6D 65 3D 22 67 43 45 5F 51 75 65 75 69 6E   name="gCE_Queuin
00000F30: 67 22 20 74 61 62 6C 65 3D 22 58 44 43 5F 4D 61   g" table="XDC_Ma
00000F40: 73 73 41 74 74 72 69 62 75 74 65 50 72 6F 64 75   ssAttributeProdu
00000F50: 63 74 22 2F 3E 0A 09 09 3C 2F 53 74 65 70 3E 0A   ct"/>___</Step>_
00000F60: 09 09 3C 53 74 65 70 20 69 64 3D 22 37 36 22 20   __<Step id="76" 
00000F70: 6E 61 6D 65 3D 22 53 65 74 20 46 69 65 6C 64 22   name="Set Field"
00000F80: 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22 3E 0A    enable="True">_
00000F90: 09 09 09 3C 43 61 6C 63 75 6C 61 74 69 6F 6E 3E   ___<Calculation>
00000FA0: 0A 09 09 09 09 3C 21 5B 43 44 41 54 41 5B 22 2E   _____<![CDATA[".
00000FB0: 39 39 22 5D 5D 3E 0A 09 09 09 3C 2F 43 61 6C 63   99"]]>____</Calc
00000FC0: 75 6C 61 74 69 6F 6E 3E 0A 09 09 09 3C 46 69 65   ulation>____<Fie
00000FD0: 6C 64 20 69 64 3D 22 33 32 39 32 35 22 20 6E 61   ld id="32925" na
00000FE0: 6D 65 3D 22 67 43 45 5F 41 75 74 6F 52 6F 75 6E   me="gCE_AutoRoun
00000FF0: 64 5F 54 79 70 65 22 20 74 61 62 6C 65 3D 22 58   d_Type" table="X
00001000: 44 43 5F 4D 61 73 73 41 74 74 72 69 62 75 74 65   DC_MassAttribute
00001010: 50 72 6F 64 75 63 74 22 2F 3E 0A 09 09 3C 2F 53   Product"/>___</S
00001020: 74 65 70 3E 0A 09 09 3C 53 74 65 70 20 69 64 3D   tep>___<Step id=
00001030: 22 37 36 22 20 6E 61 6D 65 3D 22 53 65 74 20 46   "76" name="Set F
00001040: 69 65 6C 64 22 20 65 6E 61 62 6C 65 3D 22 54 72   ield" enable="Tr
00001050: 75 65 22 3E 0A 09 09 09 3C 43 61 6C 63 75 6C 61   ue">____<Calcula
00001060: 74 69 6F 6E 3E 0A 09 09 09 09 3C 21 5B 43 44 41   tion>_____<![CDA
00001070: 54 41 5B 22 61 74 74 72 5F 70 72 6F 64 34 2E 63   TA["attr_prod4.c
00001080: 73 76 22 5D 5D 3E 0A 09 09 09 3C 2F 43 61 6C 63   sv"]]>____</Calc
00001090: 75 6C 61 74 69 6F 6E 3E 0A 09 09 09 3C 46 69 65   ulation>____<Fie
000010A0: 6C 64 20 69 64 3D 22 33 33 30 34 39 22 20 6E 61   ld id="33049" na
000010B0: 6D 65 3D 22 67 46 69 6C 65 4E 61 6D 65 5F 69 6E   me="gFileName_in
000010C0: 63 22 20 74 61 62 6C 65 3D 22 58 44 43 5F 4D 61   c" table="XDC_Ma
000010D0: 73 73 41 74 74 72 69 62 75 74 65 50 72 6F 64 75   ssAttributeProdu
000010E0: 63 74 22 2F 3E 0A 09 09 3C 2F 53 74 65 70 3E 0A   ct"/>___</Step>_
000010F0: 09 09 3C 53 74 65 70 20 69 64 3D 22 37 36 22 20   __<Step id="76" 
00001100: 6E 61 6D 65 3D 22 53 65 74 20 46 69 65 6C 64 22   name="Set Field"
00001110: 20 65 6E 61 62 6C 65 3D 22 54 72 75 65 22 3E 0A    enable="True">_
00001120: 09 09 09 3C 43 61 6C 63 75 6C 61 74 69 6F 6E 3E   ___<Calculation>
00001130: 0A 09 09 09 09 3C 21 5B 43 44 41 54 41 5B 22 4D   _____<![CDATA["M
00001140: 61 73 73 41 74 74 72 69 62 75 74 65 50 72 6F 64   assAttributeProd
00001150: 75 63 74 2E 66 70 37 22 5D 5D 3E 0A 09 09 09 3C   uct.fp7"]]>____<
00001160: 2F 43 61 6C 63 75 6C 61 74 69 6F 6E 3E 0A 09 09   /Calculation>___
00001170: 09 3C 46 69 65 6C 64 20 69 64 3D 22 33 32 37 37   _<Field id="3277
00001180: 31 22 20 6E 61 6D 65 3D 22 67 46 69 6C 65 4E 61   1" name="gFileNa
00001190: 6D 65 5F 53 75 62 6A 65 63 74 22 20 74 61 62 6C   me_Subject" tabl
000011A0: 65 3D 22 58 44 43 5F 4D 61 73 73 41 74 74 72 69   e="XDC_MassAttri
000011B0: 62 75 74 65 50 72 6F 64 75 63 74 22 2F 3E 0A 09   buteProduct"/>__
000011C0: 09 3C 2F 53 74 65 70 3E 0A 09 3C 2F 53 63 72 69   _</Step>__</Scri
000011D0: 70 74 3E 0A 3C 2F 64 75 6D 6D 79 3E 0A            pt>_</dummy>_

Share this post


Link to post
Share on other sites

So after much head bashing, I think my main issue was that some of the data clipboard had high and low ascii. I created a function that went through each byte and got rid of any high or low ascii. Then I could get it to print out to the screen with the examples.

On my way there, I was wrestling with the few examples I could find of other ways of wrangling the clipboard. I found examples showing the DllStructGetData, but I found I had an issue with not knowing the size of my clipboard. I discovered by inspection that the first few bytes describe the size. Below is a code snippet that I used (I'm not proud of it, but it works) to get the size of the clipboard, then use that to get the actual clipboard. The MyHex_2_Text() function is the one that I wrote that gets rid of the high/low ascii, converting from hex to dec to ascii for each hex.

$hMemory = _ClipBoard_GetDataEx($iFormat)
        If $hMemory = 0 Then _WinAPI_ShowError ("_ClipBoard_GetDataEx failed")
;           MemoWrite("_ClipBoard_GetDataEx($iFormat) = " & $hMemory)
        _ClipBoard_Close ()
        $tData = DllStructCreate("byte MyHex[4]", $hMemory)
        $length = DllStructGetData($tData, "MyHex")
        $length = StringTrimLeft($length,2)
;           MsgBox( 1,"length in Hex",$length)

        $length = PrepHex(StringMid($length,8,1))*16^6 + PrepHex(StringMid($length,7,1))*16^7 + PrepHex(StringMid($length,6,1))*16^4 + PrepHex(StringMid($length,5,1))*16^5 + PrepHex(StringMid($length,4,1))*16^2 + PrepHex(StringMid($length,3,1))*16^3 + PrepHex(StringMid($length,2,1)) + PrepHex(StringMid($length,1,1))*16^1
        $length = $length + 4
;           MsgBox( 1,"length in Decimal",$length)
        $tData = ""
        $MyStruct = "byte MyHex["&$length&"]"

        $tData = DllStructCreate($MyStruct, $hMemory)
;           MemoWrite("$tData size is " & DllStructGetSize($tData))
        $Hex = DllStructGetData($tData, "MyHex")
;           MemoWrite("$myHex : " & $Hex)

        $String = MyHex_2_Text($Hex)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0