Jump to content

thePixeler

Members
  • Content count

    25
  • Joined

  • Last visited

About thePixeler

  • Rank
    InsanelyMac Protégé

Contact Methods

  • Website URL
    http://

Profile Information

  • Gender
    Male
  • Location
    Rhode Island, USA
  1. split txt file into more textfiles

    Blast from the past! I don't think I can help you, man. Just yesterday I sold my Mac. All I have now is a Windows box. From my previous posts it appears that the script will only works on ".txt" files. If you're using unicode that probable means that you have ".rtf" files. I really doubt that this will work but try changing all references of ".txt" to ".rtf" in the script. I vaguely remember doing something with unicode before and you had to do something with theses funky arrows or something... You might also want to try modifying the script to use TextEdit as a means of opening and saving your files.
  2. Some noob Cocoa help

    This is pretty easy. Create a new Cocoa application. Add a new obj-c class called AppController. Open your apps xib file with IB. In IB, add a new NSObject and set it to AppController. Set the main windows delegate outlet to AppController. Change the size of the window so its width is half its height plus 11. Save the xib. Edit your AppController .m file to look like this... #import "AppController.h" @implementation AppController - (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize { NSSize newSize; // This will be the size the window is actually changed to. newSize.width = frameSize.width; // The width stays the same... newSize.height = (newSize.width * 2); // But the height needs to twice the width. NSLog(@"width: %f", newSize.width); // Log the results. NSLog(@"height: %f", newSize.height); return newSize; // Return the new size. } @end This code it pretty self explanatory. When ever the user tries to resize the window this method gets called. "sender" is the window that is being resized. "frameSize" is the size it would resize to if you didn't modify anything. The NSSize structure you return is the size that the window will resize to. Attached to this post is an Xcode project to look at if you get stuck. TwiceAsTallAsWide.zip
  3. Simple AppleScript Help

    Replace: play document "audio.wav" With: play the front document If that doesn't work then I'm out of ideas. Maybe your computer is cursed, I dunno.
  4. Simple AppleScript Help

    Does the content guide at least close now? tell application "QuickTime Player" activate delay 2 set openDocuments to (every document) repeat with i from 1 to (count openDocuments) close (item i of openDocuments) end repeat open audioFile play document "audio.wav" end tell
  5. Simple AppleScript Help

    Argh. And you though this was going to be easy. OK 6th time's the charm. Replace the whole QuickTime tell block with this new one. tell application "QuickTime Player" activate open audioFile set openDocuments to 0 set timer to 0 repeat while (count openDocuments) < 2 and timer < 10 set openDocuments to the name of every document repeat with i from 1 to (count openDocuments) play document (item i of openDocuments) end repeat set timer to (timer + 1) delay 1 end repeat end tell
  6. Simple AppleScript Help

    Hmm.... OK. Try adding a one or two second delay between the open command and the play command. So it'll look like this. open audioFile delay 2 play document theName
  7. Simple AppleScript Help

    Yes there is. Change the top line in the script to this… set audioFile to ((path to me as string) & "Contents:Resources:" & "audioFile.aif") as alias When you save the script select "Application bundle" as the file format. In the Finder, right click the newly saved app and select "Show Package Contents". Navigate to "Contents>Resources" and place your audio file there (inside the "Resources" folder). Now it's self contained.
  8. Simple AppleScript Help

    I works fine for me. AppleScript is can be so picky sometimes. Try this one. set audioFile to "Macintosh HD:Users:yourUserName:pathTo:theAudioFile.aif" as alias tell application "Finder" to set theName to (name of audioFile) tell application "QuickTime Player" activate open audioFile play document theName end tell delay 16 tell application "System Events" to set theProcesses to every process whose visible is true and name is not "Finder" and name is not (name of me) repeat with i from 1 to (count theProcesses) set thisProcess to item i of theProcesses try tell application (name of thisProcess) to quit without saving end try end repeat tell application "Finder" to shut down
  9. Simple AppleScript Help

    Try using this. set audioFile to "/path/to/your/audio/file.mp3" tell application "QuickTime Player" activate open audioFile play the front document end tell tell application "Finder" set visible of process "QuickTime Player" to false end tell delay 16 tell application "System Events" set theProcesses to every process whose visible is true and name is not "Finder" and name is not (name of me) end tell repeat with i from 1 to (count of theProcesses) set thisProcess to item i of theProcesses try tell application (name of thisProcess) to quit without saving end try end repeat tell application "Finder" to shut down What OS are you running? Also note that the computer will only shutdown if you save this script as an application and run the app. If you just click "Run" in Script Editor it wont work.
  10. Simple AppleScript Help

    OK then use this script. set audioFile to "/path/to/your/audio/file.mp3" tell application "QuickTime Player" activate open audioFile end tell tell application "Finder" set visible of process "QuickTime Player" to false end tell delay 16 tell application "System Events" set theProcesses to every process whose visible is true and name is not "Finder" and name is not (name of me) end tell repeat with i from 1 to (count of theProcesses) set thisProcess to item i of theProcesses try tell application (name of thisProcess) to quit without saving end try end repeat tell application "Finder" to shut down Don't forget to edit the first line to point to the audio file you want QuickTime to play and to save it as an application.
  11. Simple AppleScript Help

    What about QuickTime? Every Mac has QuickTime installed. Or do you not want the user to see the QuickTime window. if you don't, then making a Cocoa app is the only way I can think of that will do what you want.
  12. Simple AppleScript Help

    AppleScript by itself can't play audio files. Would it be OK it QuickTime played the audio clip? Or you could use something like Play Sound.
  13. Hmmm... I'm not sure how to download and save a stream.
  14. What part of the URL changes? And do you want to download the "breedband" or "smallband" version?
  15. Objective-C: Fetching Events

    I know. Just out of curiosity, can you detect when a song changes automatically, or do you have to use a timer and keep checking to see if it has changed.
×