Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Script

 
   Macintosh computer (Home) -> Apple Scripts RSS
Next:  [ANN] Power Manager 3.6.1 - Inactivity fix for Ma..  
Author Message
danieltomasch

External


Since: May 29, 2007
Posts: 4



(Msg. 1) Posted: Wed May 30, 2007 9:10 pm
Post subject: Script
Archived from groups: alt>comp>lang>applescript (more info?)

Can I get opinions on there being an easier way to do this?

I've set up a key-combo via Butler that pulls up this script.

set getURL to display dialog "URL?" default answer "" buttons {"net",
"org", "com"} default button 3
set theURL to text returned of getURL
set theDomain to button returned of getURL
if theURL begins with "http://www." then
set theURL2 to theURL
else if theURL begins with "www." then
set theUR2 to "http://" & theURL
else
set theURL2 to "http://www." & theURL
end if
if theURL2 ends with ".com" or ".net" or ".org" then
tell application "Safari"
activate
open location theURL2
end tell
else
tell application "Safari"
activate
open location theURL2 & "." & theDomain
end tell
end if


The point is I can type in a URL and it pipes it to Safari.

If I just pipe the input straight into Safari, I get an error, so I
wrote the two if routines to handle some possible combinations.

Any feedback?

 >> Stay informed about: Script 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Help with script - What is the difference between these two scripts and why does the 1st one not work? Do I need to declare (or dim) variables at the beginning? ----- #1 tell application "FileMaker Pro7" tell layout "layout_name" set aVar to cell &...

Help with script, please - Here is the script: tell application "Mail" set foo to the selection set foo to item 1 of foo set address_ to address of item 1 of to recipient of foo if not (name of item 1 of to recipient of foo exists) then set AppleScript...

Help with script - From an obvious novice: I'd like to have a script for my wife that will open the display preferences and select a certain screen resolution and colors ( i.e. 256/thousands/millions). I can get as far as opening the preferences pane but I can't set....

Help with Rename Script - I'm trying to create a script that copies the name of a folder the file that is saved within that folder. For example, I have a folder called: chicago and a file called template.html I want the file to be renamed to: chicago_IL.html Here's what I'v...

Safari Script - What I want to be able to do is write a script to run in batch mode to interact with a web browser. That is, I want to be able to write jobs that will act as though I, as a user, were using the mouse and keyboard to interact with the pages on a site. ..
   Macintosh computer (Home) -> Apple Scripts All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]