Jump to content

ning

Active Members
  • Posts

    92
  • Joined

  • Last visited

Everything posted by ning

  1. Never mind: I managed to work it out... ;set tags to ISO-8859-1 encoding (for compatibility with car MP3 CD player) Func setISO88591Tags ($fileName) ;~ ConsoleWrite($fileName & @LF) $sTagInfo = _ID3ReadTag($Filename, 2) ;ID3v2 only - no encoding issue with ID3v1 ;~ ConsoleWrite($sTagInfo & @LF) $sTagInfo = StringSplit ($sTagInfo, @CRLF, 1) If $sTagInfo[0] > 1 Then ;tag definitely present $sTagInfo = StringSplit ($sTagInfo[2], "|") For $i = 2 To $sTagInfo[0] ;~ ConsoleWrite($sTagInfo[$i] & @LF) $tagSplit = StringSplit ($sTagInfo[$i], ":") $tagName = $tagSplit[1] For $j = 1 To $tagSplit[2] $tagFields = _ID3v2Frame_GetFields ($tagName, $j, 1) ;~ _ArrayDisplay($tagFields) If $tagFields[$tagFields[0]] > 0 Then $tagFields[$tagFields[0]] = 0 ;set encoding to ISO-8859-1 $tagChanged = True _ID3SetTagField ($tagName, $tagFields, $j) EndIf Next Next if $tagChanged Then _ID3WriteTag ($Filename) ConsoleWrite("--Updated " & $fileName & " tag encoding to ISO-8859-1" & @LF) EndIf EndIf Return FileGetSize ($fileName) ;may have changed EndFunc That seems to get the job done; I just need to check now that the files created using this can be read by my car's MP3 player.
  2. Hi, Is it possible to use this code to change the character encoding on MP3s? I'd like to change some MP3s from ID3v2.4, UTF-8 encoding to ID3v2.3, ISO-8859-1 encoding. (This is so my in-car MP3 player will recognise them correctly.) Your code seems to read ISO-8859-1 encoded MP3s correctly, but I couldn't see how to set the encoding manually. Is this possible? Thanks - an excellent UDF by the way!
  3. I've tried both of those, and it still happens! ben
  4. There's a problem with my installlation of SCiTE4AutoIt3 on my laptop. Whenever I type certain phrases in comments or strings in an .au3 file, it immediately autocompletes with (usually) some unwanted AutoIt keyword. There's no dropdown, the word just appears immediately. For instance, I want to type "C:\Network\ASTeC" (with quotes, i.e. a string). When I press N followed by E for 'Network', it immediately turns into 'Next'. This is extremely annoying. I've put up with it for a while, but I can stand it no longer. I've searched the forums but can't find anyone else that's had the same problem. I've made a clean installation (i.e. uninstalled and deleted the Program Files\AutoIt3 folder prior to installation) of AutoIt3 v3.3.2 and SCiTE4AutoIt3, but it still happens. Is there an option somewhere in the .properties files to fix this? I don't understand why it happens with a clean installation though - does SCiTE alter any registry keys? Thanks... ben
  5. Maybe use the _XMLDOMWrapper stuff?
  6. No, that's the only one...
  7. Hi, I'm trying to create a mini RSS reader, using the excellent _XMLDOMWrapper code posted here. Looking at this code: <?xml version="1.0" encoding="ISO-8859-1" ?> <rss version="2.0"><channel> <title>BBC News | News Front Page | UK Edition</title> <link>http://news.bbc.co.uk/go/rss/-/1/hi/default.stm</link> <description>Visit BBC News for up-to-the-minute news, breaking news, video, audio and feature stories. BBC News provides trusted World and UK news as well as local and regional perspectives. Also entertainment, business, science, technology and health news.</description> <language>en-gb</language> <lastBuildDate>Mon, 16 Oct 2006 13:33:37 GMT</lastBuildDate> <copyright>Copyright: (C) British Broadcasting Corporation, see http://news.bbc.co.uk/1/hi/help/rss/4498287.stm for terms and conditions of reuse</copyright> <docs>http://www.bbc.co.uk/syndication/</docs> <ttl>15</ttl> ... I can extract the title ('BBC News | News Front Page | UK Edition') using the function _XMLGetField ('/rss/channel/title'). However, I have problems with this code: <?xml version="1.0" encoding="UTF-8"?> <feed version="0.3" xmlns="http://purl.org/atom/ns#"> <title>Gmail - Inbox for bjashepherd</title> <tagline>New messages in your Gmail Inbox</tagline> <fullcount>8</fullcount> <link rel="alternate" href="http://mail.google.com/mail" type="text/html"/> <modified>2006-10-23T06:42:30Z</modified> I should be able to extract the title ('Gmail - Inbox for bjashepherd') using the function _XMLGetField ('feed/title'). But it doesn't work - it throws an error ("Error Retrieving: feed/title / No matching node(s)found!"). What's the difference? ben
  8. Smashly: thanks, I'll try that. qafrost: I can't see that particular menu entry in SciTE, maybe I don't have the newest version... ben
  9. Is it currently possible to add icons to menu items? Something like this is what I have in mind: And if not, are there any plans to add this functionality in the future? (I want to build a tiny RSS reader that would go in the tray, blending several feeds into one and ordering by time. The icon for each item should be the website's favicon.) ben
  10. Hi, I'm trying to write an AutoIt interface to a frame grabber card I have at work. The card grabs an image from a camera and places it in a buffer. There's an ActiveX interface to it, which I've succeeding in getting AutoIt to talk to. The card generates an event, onFrameComplete, which passes a DTBuffer object to an AutoIt function. This works, since I can access properties like DTBuffer.Width and get the right answer. There is a method GetData which returns a 2d array corresponding to the image in the buffer. But the variable returned by this does not have the correct structure. i.e. $data = $buffer.GetData() IsArray ($data) returns 1 - so it is an array However - UBound ($data, 0) returns 0. This should be 2 - the number of dimensions. But it isn't. What's going on? Is it a pointer to an array or something? Is this a limitation of AutoIt, that it can't handle arrays returned by COM objects? Or am I doing something else wrong? ben
  11. Thanks. Useful information, but not really what I was asking. I'm sure I could find out how to make a GET request, and write the necessary code. The question is, is it worth it? Would that make things run all that much faster when I'm making several requests from the same server? ben
  12. Hello, I'm writing a program that makes lots of small HTTP requests (to Flickr) via InetGet. I imagine that doing things this way creates a fair bit of overhead in terms of creating connections and closing them again. Is it worth me writing a function that implements HTTP GET in TCP functions? Or is there some other way of speeding the process up? Any way of doing more than one request at a time would be very useful too. I used a compiled script that just wrapped InetGet to do this but it seems a bit hacky - and I'm not sure it really makes any difference. ben [edit: hey, that's weird. The board has 'sentence cased' my post title. Dammit, HTTP GET and TCP are abbreviations!]
  13. The problem you have is that when Start is clicked, the program goes into an infinite loop in _Loop(). So it will never execute the code asking it to stop. What you need is an Adlib function. Look it up in the help, but this _should_ do the trick (untested): If $msg = $start Then AdlibEnable ("_loop", 1000) If $msg = $stop Then AdlibDisable () Don't forget to take out the Sleep (1000) in the function. ben
  14. I don't understand what you mean. Are you suggesting I use WinSetTrans? I don't want to fade a window in though - I want to slide it in from the side.
  15. Hello (me again - sorry!), I want to use DLLCall with the AnimateWindow function to animate a transition between two (usually fullscreen) windows. To start with, I'd like to slide one window out of the screen while sliding another one in from the other side. To do this I need to run AnimateWindow simultaneously on two windows. But DLLCall waits until the DLL process completes before it goes to the next command. Is there a way of making it work in the background - equivalent to Run vs. RunWait? I tried encapsulating the functionality in a compiled script with command-line args and Run()ning that, but it didn't work at all - it's as if the DLL call started and then immediately stopped; it draws the window border but that's it. cheers ben
  16. Thanks all. So basically there's no better way than asking the mighty Google. Fine by me, I just naively assumed that they'd be somewhere on MSDN. Stupid Microsoft. ben
  17. Hello, I've been using DLLCall a bit more lately, especially with Windows API functions. The MSDN website has been pretty useful for this - the only drawback is that I've been unable to find listed values for constants on the site (e.g for the flags in this function). Does anyone know a reliable source for these? So far I've just Googled for them, and that's been successful every time - I just wondered if there was a better way. cheers ben
  18. Thanks everyone. SmOke_N: That's interesting, I hadn't thought of that. I'll have a think and see if I can come up with an obscure key code. One that wasn't even on the standard keyboard would be useful (there must be 'expansion' keycodes - can we use those? I'm thinking like HotKeySet ("{0xFF}") or something like that). DaveF: Nice example. I didn't really want to be 'polling' something in a loop, but I guess something has to at some point, and that's a pretty elegant solution. Skruge: My understanding of the dummy control was that it would only work within one script. You create a dummy control, and then use GUICtrlSendToDummy within that script for a notification. Does it work if you call it from another script? One thing I know is possible in Linux is sending 'signals' to running processes, for example telling them to quit, restart or of some kind of OS error. There are also a couple of user-defined ones. Is there some equivalent to this in Windows? cheers ben
  19. Hello, So I'm writing a program split into two halves - one downloads photos from Flickr while the other half displays them in a window, updating when there's a new one available. (I've set it up like this because the user interface wasn't responsive enough when it was trying to do both things at once.) Is there a good way of getting one half to send a notification to the other half? A simple 'ping' would suffice; there's some information to send but that could be placed in a file. The only thing I've come up with so far is a hidden window with a couple of buttons that can be clicked. The trouble is, this doesn't seem to work when the window is hidden (GuiSetState (@SW_HIDE)), so I resorted to placing it beyond the edge of the screen. Still appears in the taskbar though. I don't want to have to poll a file or registry entry every so often. Is there a way of doing this with GuiRegisterMsg or something? cheers ben
  20. The Animate Display thing is an absolute stroke of genius! I presume the '1000' in each call is the time to take. Thanks a lot - that's going in my slideshow program. ben
  21. This (check the first reply to the topic) looks like it does what you want. Try it and see. ben
  22. Works for me, with: Run ('"c:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE" /a "E:\desktop.ini"') Note that the program filename and the attachment filename are surrounded by double quotes ("), and the whole expression is surrounded by single quotes (') so that the double quotes are not interpreted as the end of the string. ben
  23. Yep, and with @HotKeyPressed you can set it up to respond to a range of keys. I know this can be implemented in user code, it would just be nice to have a builtin function to do it. ben
  24. How about setting a local hotkey? In other words, if your hotkey is pressed and your GUI is active, it gets the message, otherwise it gets ignored. Obviously it's possible to do that in a script, but a builtin function would be good. ben
  25. Hello, I've got a VBA project (in Excel) which calls a DLL function, and one of the parameters (the important one, naturally) is a double-precision floating point number. The actual code used to declare the function looks like this: Declare Function FastRPC Lib "Z:\WINDOWS\SYSTEM32\FastRPC.DLL" (ByVal parameter As String, ByVal Property As String, ByVal mode As Integer, DataPtr As Any, ByVal ItemCount As Long) As Long The DataPtr is the argument I'm referring to. This is passed by reference and is a Double in the implementation of the function elsewhere in the code. How can I reproduce this code using DllCall in AutoIt? There seems to be no mention of a 'double' (or any non-integer) datatype in the documentation for DllCall. Any ideas? ben
×
×
  • Create New...