Simple Input Output Script

Discussion in 'Mac Programming' started by shurgie, Jan 30, 2013.

  1. macrumors regular

    Joined:
    May 16, 2008
    Location:
    LI
    #1
    I'm just looking for a way to be able to enter 3 different variables a URL, a Number and a Platform.

    I would then like the output to be URL&arcNumber%aPlatform

    I tried making a few automator scripts and looking for a program or two but haven't been able to get it done right.
    I would appreciate this being exported to the clipboard or a simple text edit window. I am using this to upload tracked URL's to my sites and it would be a lot easier with a script then copying and pasting on my own everytime.
     
  2. dmi
    macrumors regular

    Joined:
    Dec 21, 2010
    #2
    #!/bin/bash
    echo "enter a URL"
    read URL
    echo "ener a Number"
    read Number
    echo "enter a Platform"
    read Platform
    echo "$URL&arc$Number%a$Platform"
     
  3. macrumors member

    Joined:
    Jun 17, 2012
    #3
    If you want that to go to the clipboard:

    Code:
    #!/bin/bash 
    echo "enter a URL"
    read URL
    echo "ener a Number"
    read Number
    echo "enter a Platform"
    read Platform
    echo -n "$URL&arc$Number%a$Platform" | pbcopy
     
  4. macrumors 6502

    superscape

    Joined:
    Feb 12, 2008
    Location:
    Yorkshire, UK
    #4
    Or in AppleScript

    Since you didn't specify a language, here's a way of doing it in AppleScript:

    Code:
    
    set theURL to text returned of (display dialog "Enter a URL" default answer "")
    set theNumber to text returned of (display dialog "Enter a number" default answer "")
    set thePlatform to text returned of (display dialog "Enter a platform" default answer "")
    
    set the clipboard to theURL & "&arc" & theNumber & "%a" & thePlatform
    
    
     
  5. thread starter macrumors regular

    Joined:
    May 16, 2008
    Location:
    LI
    #5
    Thank you very much all! I will start checking them out now I appreciate all the help knew it was easy sometimes you just need another persons help! :)
     

Share This Page