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

Automatic title and saving of the same

 
   Macintosh computer (Home) -> Apple Scripts RSS
Next:  Subroutine actions  
Author Message
Jo_y

External


Since: Jun 22, 2008
Posts: 30



(Msg. 1) Posted: Wed Jun 25, 2008 6:42 am
Post subject: Automatic title and saving of the same
Archived from groups: alt>comp>lang>applescript (more info?)

Hi,
i wrote a script for the Script Editor, which tracks the first line of
my front document and converts (whitespaces includet) :
a) the first line in the title of front document and..
b) asks me where to save this document (in front win of Finder -else
the Desktop-folder if no win are open or in the path of window x of a
open Applescript-window)

now, i ask myself if there is a way to write a similary script where
works for every application ?
the main problem is to tell the script the right frontmost
application. Like the script below, but it doesn't run.


--Test1

tell application "Finder" to set v to desktop as text
tell application "System Events" to set h to name of front process
whose accepts high level events is true and visible is true and name
is not "Finder"
tell h
try
set w to window 1
on error
set w to document 1
end try
set x to w
set y to line 1 of w as text
set ff to (v & y as text)
save ff
end tell

Ciao!

 >> Stay informed about: Automatic title and saving of the same 
Back to top
Login to vote
Jo_y

External


Since: Jun 22, 2008
Posts: 30



(Msg. 2) Posted: Thu Jun 26, 2008 3:13 am
Post subject: Re: Automatic title and saving of the same [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Anyone has ideas how to get a functional script of the text below ?


--Test

tell application "System Events"
set x to name of every process whose frontmost is true
set x to x as text
end tell
tell application "Finder"
set y to (folder of front window) as text
set the_path to (y & "Test")
end tell

tell application x
activate application x
try
set i to window 1
on error
set i to document 1
end try
try
save i in the_path
on error the error_message number the error_number
display dialog "Error: " & the error_number & ". " & the
error_message buttons {"Cancel"} default button 1
end try
end tell

 >> Stay informed about: Automatic title and saving of the same 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
How to script "Internet Connect" for automatic pppoe conne.. - Hello, I am trying to write a script for reconnecting my pppoe connection, but the most important command seems not to work with me! When I write: tell application "Internet Connect" to connect configuration "pppoe" It gives me...

Saving Data to a File? - I'm an Applescript newbie. I want to make an Applescript create a file, and store some string data in it, without calling any other application. Can anyone point me in the direction of examples of how this is done? Thanks very much in advance for any....

Scripting saving of PDFs in Word (on Tiger) - Hey all -- (Warning: AppleScript newbie!) I managed to handle some of the elements of the Print dialog in Word with the following, but the comments inside will explain the rest: tell application "System Events" tell application process &quo...

saving a mail.app message into a text file - Hi everybody I have a newbie request for mail.app 2.0.7 running on OSX 10.4.6. I'd like to complement a rule moving new email with subject "XYZ" into mailbox "ABC" with a script that writes each of these messages into files named..

Saving new created plist file to users library - Hi, i run a short .plist (at the moment located on my Desktop) check on launch of my applescript droplet code. If the plist is existing nothing happens. If it does not exists it creates a new .plist Basicly that was the idea to create the initial plist....
   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 ]