Little help with an AppleScript
I had an applescripter or create this AppleScript for me a few years back but it appears that he is no longer in business. I can't figure out why it is not working? Any ideas would be most appreciate it.
The point of the script is to extract the information out of an email using Apple's Mail.app and to re-create a new email with each new group and repeat until all on the list have been contacted. See info below for Script and sample email.
-------- Byrd Engineering,LLC (c) 2008
------ http://www.byrdengineering.net
Notes & Software Errata
1. If signature.txt is not located in the ~/Library/Scripts folder the program will not do anything. If the file does not exist Applescript creates it and
then attempts to read it, however it is empty. Therefore the variable assignment is empty as well and Applescript perceives it as an error.
2. To: change the subject, sender name, or disable Mail.app from opening a window each time it composes a message.
Enable the compose mail window
set MyVisible to "true"
Disable the compose mail window
set MyVisible to "false"
set MySubject to "Welcome greeting goes here"
set myname to "Dr. David Hughes"
3. The get_entry subroutine extracts that data based on the assumption that the delimiter ":" is followed
by two spaces (ascii character 32)
to adjust this value if the format of the email changes, increment or decrease the
property string_ptr: "3" value.
property string_ptr : "3"
property lower_alphabet : "abcdefghijklmnopqrstuvwxyz"
property upper_alphabet : "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
property white_space : {space, tab, return, ASCII character 10, ASCII character 13}
-- Thanks to Qwerty Denzel on bbs.macscripter.net for adaptation of
-- of Apple's change case of item names.scpt
-- change_case()
-- Called from get_entry()
-- Parameters:
-- this_str - paragraph
-- this_case:
-- UPPER - convert to uppercase
-- lower - convert to lowercase
-- sentence - capitalize the first letter of the string.
-- Title - capitalize the first letter of each word.
on change_case(this_text, this_case)
set new_text to ""
if this_case is not in {"UPPER", "lower", "Title", "Sentence"} then
return "Error: Case must be UPPER, lower, Title or Sentence"
end if
if this_case is "lower" then
set use_capital to false
else
set use_capital to true
end if
repeat with this_char in this_text
set X to offset of this_char in lower_alphabet
if X is not 0 then
if use_capital then
set new_text to new_text & character X of upper_alphabet as string
if this_case is not "UPPER" then
set use_capital to false
end if
else
set new_text to new_text & character X of lower_alphabet as string
end if
else
if this_case is "Title" and this_char is in white_space then
set use_capital to true
end if
set new_text to new_text & this_char as string
end if
end repeat
return new_text
end change_case
-- get_entry()
-- Calls:
-- change_case()
-- Parameters:
-- this_str - paragraph
-- this_case:
-- UPPER - convert to uppercase
-- lower - convert to lowercase
-- sentence - capitalize the first letter of the string.
-- Title - capitalize the first letter of each word.
-- Returns:
-- Data formatted according to case parameter.
on get_entry(this_str, this_case)
-- To avoid error test last character. If last character = ":" then no data, insert "N/A" else process the entry.
-- If last character of line is ascii char 32 this email message is from Thunderbird client
-- If last character of line is ascii char 58 this email message is from OS X Mail.ap
-- Inserted by Michele Percich 05/02/2010
log (ASCII number of last character of this_str)
if this_str ends with (ASCII character 32) or this_str ends with (ASCII character 58) or this_str ends with (ASCII character 202) then
-- if last character of this_str ends with (ASCII character 32) or last character of this_str ends with (ASCII character 58) then
set token to " N/A"
set this_case to "upper"
else
set token to characters ((offset of ASCII character 58 in this_str) + string_ptr) thru -1 of this_str
end if
set token to my change_case(token, this_case)
return token
end get_entry
on getSig()
set SigFilePath to (path to scripts folder as string) & "signature.txt" as string
set SigFile to open for access SigFilePath
set SigFileContents to (read SigFile)
close access the SigFile
return SigFileContents
end getSig
tell application "Mail"
set selected_messages to selection
repeat with current_message in selected_messages
set theContent to content of current_message
end repeat
-- Save the orginal delimiters so we can restore them.
set ASTID to AppleScript's text item delimiters
set MySignature to my getSig()
-- Get the number of paragraphs(i.e. lines) in the message.
set LineCount to count paragraphs of theContent
--display dialog "paragraph =" & LineCount
repeat with i from 1 to LineCount
-- Read a single paragraph
set entry_index to paragraph (i) of theContent
-- We've located the beginning of information block therefore we can reference the remaining data
-- from our current position + N.
if entry_index contains "New Associate Name:" then
-- New Associate Name
set NewHire to my get_entry(entry_index, "Title")
-- City remove comment for future use
set tmpRecord to paragraph (i + 1) of theContent as string
set City to my get_entry(tmpRecord, "Title")
-- Region
set tmpRecord to paragraph (i + 2) of theContent as string
set Region to my get_entry(tmpRecord, "UPPER")
-- phone
set tmpRecord to paragraph (i + 3) of theContent as string
set NewHirePhone to my get_entry(tmpRecord, "lower")
-- Recipient Email
set tmpRecord to paragraph (i + 4) of theContent as string
set RecipientEmail to my get_entry(tmpRecord, "lower")
-- enrollment date
set tmpRecord to paragraph (i + 5) of theContent as string
set startDate to my get_entry(tmpRecord, "Title")
-- Director
set tmpRecord to paragraph (i + 8) of theContent as string
set Director to my get_entry(tmpRecord, "Title")
-- Director Phone
set tmpRecord to paragraph (i + 9) of theContent as string
set Director_Phone to my get_entry(tmpRecord, "lower")
-- Placing Associate
set tmpRecord to paragraph (i + 10) of theContent as string
set Placing_Associate to my get_entry(tmpRecord, "Title")
-- Placing Associate Phone
set tmpRecord to paragraph (i + 11) of theContent as string
set Placing_Associate_Phone to my get_entry(tmpRecord, "lower")
-- Executive Director
set tmpRecord to paragraph (i + 12) of theContent as string
set Executive_Director to my get_entry(tmpRecord, "Title")
-- Executive Director Phone
set tmpRecord to paragraph (i + 13) of theContent as string
set Executive_Director_Phone to my get_entry(tmpRecord, "lower")
-- Associate
set tmpRecord to paragraph (i + 10) of theContent as string
set Associate to my get_entry(tmpRecord, "Title")
-- Associate Phone
set tmpRecord to paragraph (i + 11) of theContent as string
set Associate_Phone to my get_entry(tmpRecord, "Title")
set Sentence0 to NewHire & "," & (ASCII character 10) & (ASCII character 10)
set Sentence1 to "I want to welcome you to the team!" & (ASCII character 10) & (ASCII character 10)
set Sentence2 to "Since becoming a Marketing Associate on " & startDate & ", I hope you are already off to a great start. This email will help to ensure you have the proper tools and resourses needed to succeed." & (ASCII character 10) & (ASCII character 10)
set Sentence3 to City & ", " & Region & " is a great market in which to build your business, but keep in mind, you can build your business all across North America." & (ASCII character 10) & (ASCII character 10)
set Sentence4 to "There are so many people willing to help you succeed. You just need to ask. Here are some contact numbers you can call for support. Be sure to call them and introduce yourself to them." & (ASCII character 10) & (ASCII character 10)
set Sentence5 to "The person that recruited you: " & Placing_Associate & ", " & Placing_Associate_Phone & (ASCII character 10)
set Sentence6 to "Your Director: " & Director & ", " & Director_Phone & (ASCII character 10)
set Sentence7 to "Your Executive Director: " & Executive_Director & ", " & Executive_Director_Phone & (ASCII character 10)
set Sentence8 to "Your Executive Director: Dr. David Hughes" & (ASCII character 10)
set MyMessage to Sentence0 & Sentence1 & Sentence2 & Sentence3 & Sentence4 & Sentence5 & Sentence6 & Sentence7 & Sentence8 & MySignature
set WelcomeMessage to make new outgoing message with properties {subject:"Have you seen the latest?!", sender:"David Hughes", content:MyMessage & return, visible:false}
tell WelcomeMessage
make new to recipient at end of to recipients with properties {name:NewHire, address:RecipientEmail}
send WelcomeMessage
end tell
end if
end repeat
end tell
Sample Email:
<Personal Information Edited by Host>
The moderator has edited out the sample email as it would seem you did not anonymise it.
Can you repost it with sensitive information xxxed out? (e.g. [email protected])
You don't say what problem you are getting. A description would help...
Similar Messages
-
Need a little Help with my new xfi titanium
+Need a little Help with my new xfi titanium< A few questions here.
st question? Im using opt out port on the xfi ti. card and using digital li've on a windows 7 64 bit system,? I would like to know why when i use 5. or 7. and i check to make sure each speakear is working the rear speakers wont sound off but the sr and sl will in replace of the rear speakers. I did a test tone on my sony amp and the speaker are wired correctly becasue the rear speakers and the surrond? left and right sound off when they suppose too. Also when i try to click on? the sl and sr in the sound blaster control panel they dont work but if i click on the rear speakers in the control panel the sl and sr sound off. Do anyone know how i can fix this? So i would like to know why my sl and sr act like rears when they are not?
2nd question? How do i control the volume from my keyboard or from windows period when using opt out i was able to do so with my on board? sound max audio using spidf? Now i can only control the audio using the sony receiver.
Thank you for any help../Re: Need a little Help with my new xfi titanium? ?
ZDragon wrote:
I'm unsure about the first question. Do you even have a 7. system and receiver? If you just have 5., you should be able to remap the audio in the THX console.
I do have a sony 7. reciever str de-995 its an older one but its only for my cpu. At first i didnt even have THX installed because it didnt come with the driver package for some reason until i downloaded the daniel_k support drivers and installed it. But it doesnt help in anyway.
I have checked every where regarding the first question and alot of people are having problems getting sound out of there rear channels and the sound being re-mapped to the surround right and the surround left as if there rear left and rear right.
I read somewhere that the daniel_k support drivers would fix this but it didnt for me and many others.
For the second question i assumed it would be becasue of the spidf pass through and that my onboard sound card was inferior to the xfi titaniums. But i wasnt sure and i was hopeing that someone would have a solution for that problem because i miss controlling the volume with my keyboard. -
Need a little help with syncing my iPod.
I got a new macbook pro for cristmas and a few cds. After i tried to sync my ipod to itunes i put a symbol next to each song that i got from other cds saying that they were downloading but they werent. Also the cds i downloaded to my ipod for the first time didnt appear at all. Need help.
/Re: Need a little Help with my new xfi titanium? ?
ZDragon wrote:
I'm unsure about the first question. Do you even have a 7. system and receiver? If you just have 5., you should be able to remap the audio in the THX console.
I do have a sony 7. reciever str de-995 its an older one but its only for my cpu. At first i didnt even have THX installed because it didnt come with the driver package for some reason until i downloaded the daniel_k support drivers and installed it. But it doesnt help in anyway.
I have checked every where regarding the first question and alot of people are having problems getting sound out of there rear channels and the sound being re-mapped to the surround right and the surround left as if there rear left and rear right.
I read somewhere that the daniel_k support drivers would fix this but it didnt for me and many others.
For the second question i assumed it would be becasue of the spidf pass through and that my onboard sound card was inferior to the xfi titaniums. But i wasnt sure and i was hopeing that someone would have a solution for that problem because i miss controlling the volume with my keyboard. -
Help with Simple Applescript for Midipipe
Hey all, I'm in desperate need of help with some Applescript for use in a program called Midipipe:
http://web.mac.com/nicowald/SubtleSoft/MidiPipe.html
I simply require an Applescript for Midipipe that filters out all OFF notes except for the most recently pressed key, or most recently pressed ON note. So for example, when multiple keys have been pressed, only the most recently pressed key will send an OFF note. I hope that is clear enough, i've had some major issues trying to get this work and my last hope is to hit the forums and find some help .. I've posted on some of the audio forums and i'm hoping someone here knows how to code this.
Thanks so much!! .. Its for an upcomming show next week so i'm hoping someone can get me in the right direction to solving this.
-JesI try to help, but you'll need to apply your brain cells to get it working with what I've already explained (three times with what I offer below). Try something like the following (I am renaming your buttons to ch1,ch2,ch3,ch4,ch5,ch6 so that the same functions can be shared by all buttons...
// this assigns listeners to all 6 buttons
for(var i:uint=1; i<7; i++){
this["ch"+String(i)].addEventListener(MouseEvent.CLICK, fl_ClickToSeekToCuePoint);
// this processes any one of the 6 btns when they are clicked
function fl_ClickToSeekToCuePoint_1(event:MouseEvent):void
var btn = event.currentTarget;
var cuePointInstance:Object = vid.findCuePoint(btn.name);
vid.seek(cuePointInstance.time);
resetButtons(); // this makes all buttons go back to normal
btn.upState = btn.overState; // this makes the clicked button change states
function resetButtons():void {
for(var i:uint=1; i<7; i++){
this["ch"+String(i)].upState = this["ch"+String(i)].hitTestState;
For this to work, your buttons need to have the same artwork in the hit frame as they do in the up frame. -
Need a little help with dial setup on CME
I've got a CME I'm using for testing and I think I need a little help figuring out the proper config to get the system to accept numbers I dial and have those numbers be passed on to an Avaya system (including the leading 9 for ARS in Avaya) via H.323 IP trunks. I have it working well for internal 5 digit extension calls across the H.323 trunks and I also have it working well for some types of outside calls that gets passed on to the Avaya and then the Avaya dials the call out to the PSTN. My only real problem is, I can't figure out how to correctly configure CME to examine the digits I'm dialing and only send the digits once I'm finished dialing....not as soon as it sees an initial match.
What's happening is this. I can dial local numbers in my area as 7 digits or 10 digits. The phone company doesn't yet force us to dial area code and number for local calls (10 digits). I can still dial 7 digits. But...if I put an entry in CME that looks like this....
(by the way, the 192.168.1.1 IP is not the real IP address, that's just an example, but the rest of this entry is what I really have entered in CME)
dial-peer voice 9 voip
description Outside 7 Dig Local Calls Via Avaya
destination-pattern 9.......
session target ipv4:192.168.1.1
dtmf-relay h245-alphanumeric
no vad
...Then it will always try to dial out immediately after seeing the first 8 digits I dial (9 plus the 7 digit number I called)...even though I have a speicifc entry in the system that accounts for calls to 9 plus area code 513. I would have assumed that if I put the specific entry in for 9513....... it would see that and wait to see if I was actually dialing something to match 9513....... instead of 9....... Understand what I mean? Because 9513....... is more specific than 9....... but it still tries to send the call out immediately after seeing the first 8 digits I dialed.
dial-peer voice 9513 voip
description Outside 10 Dig Local Calls Via Avaya
destination-pattern 9513.......
session target ipv4:192.168.1.1
dtmf-relay h245-alphanumeric
no vad
...BUT...here's the interesting thing. If I trace the 10 digit call in Avaya, I see that the number being presented to the Avaya PBX is only the first 7 digits of the number....not the full 10 digits...BUT I see a few more of the digits I dialed (like the 8th and 9th digits) after the call is already setup and sent to the PSTN. It's like the CME is trying to send the rest of the 10 digits I dialed, but at that point it's already too late. It setup the call as a 7 digit call (9 plus 7 digits), not 10 digit like I wanted.
I'm more familiar with how to setup dialing in the Avaya via ARS. My background is Avaya, not Cisco, so this dial-peer config is a little difficult for me until I understand the reasoning of how it examines the numbers and what I should do to make it wait for me to finish dialing....or to tell the system that what I'm dialing will be a minimum or a certain amount of digits and maximum of a certain amount of digits, like the Avaya does. I just need some pointers and examples to look at :-) I think I've almost got it....but I'm just missing something at the moment.
Just so you understand, the call flow should be like this: Cisco phone registered to CME > CME to Avaya via H.323 trunks > Avaya to PSTN via ISDN PRI trunks connected to Avaya. I have to be sure I send the 9 to the Avaya also, because 9 triggers ARS in the Avaya.
Thanks for your helpHere is a good document that explains how dial-peers are matched in the Cisco world:
http://www.cisco.com/en/US/tech/tk652/tk90/technologies_tech_note09186a008010fed1.shtml#topic7
In your case, it is variable length dial plan you are trying to implenent. To fix it, you need to add a T to force the system to wait for more digits to be entered if there is any.
dial-peer voice 9 voip
description Outside 7 Dig Local Calls Via Avaya
destination-pattern 9.......T
session target ipv4:192.168.1.1
dtmf-relay h245-alphanumeric
no vad
dial-peer voice 9513 voip
description Outside 10 Dig Local Calls Via Avaya
destination-pattern 9513.......
session target ipv4:192.168.1.1
dtmf-relay h245-alphanumeric
no vad
You can also configure the inter-digits timeout using the command timeouts interdigit under telephony-service.
Please rate helpful answers! -
Little help with complex XML data as data provider for chart and adg
Hi all,
I've been trying to think through a problem and Im hoping for
a little help. Here's the scenario:
I have complex nested XML data that is wrapped by subsequent
groupings for efficiency, but I need to determine if each inner
item belongs in the data collection for view in a data grid and
charts.
I've posted an example at the bottom.
So the goal here is to first be able to select a single
inspector and then chart out their reports. I can get the data to
filter from the XMLListCollection using a filter on the first layer
(ie the name of the inspector) but then can't get a filter to go
deeper into the structure in order to determine if the individual
item should be contained inside the collection. In other words, I
want to filter by inspector, then time and then tag name in order
to be able to use this data as the basis for individual series
inside my advanced data grid and column chart.
I've made it work with creating a new collection and then
looping through each time there is a change to the original
collection and updating the new collection, but that just feels so
bloated and inefficient. The user is going to have some buttons to
allow them to change their view. I'm wondering if there is a
cleaner way to approach this? I even tried chaining filter
functions together, but that didn't work cause the collection is
reset whenever the .refresh() is called.
If anyone has experience in efficiently dealing with complex
XML for charting purposes and tabular display purposes, I would
greatly appreciate your assistance. I know I can get this to work
with a bunch of overhead, but I'm seeking something elegant.
Thank you.Hi,
Please use the code similar to below:
SELECT * FROM DO_NOT_LOAD INTO TABLE IT_DO_NOT_LOAD.
SORT IT_DO_NOT_LOAD by WBS_Key.
IF SOURCE_PACKAGE IS NOT INITIAL.
IT_SOURCE_PACKAGE[] = SOURCE_PACKAGE[].
LOOP AT IT_SOURCE_PACKAGE INTO WA_SOURCE_PACKAGE.
V_SYTABIX = SY-TABIX.
READ TABLE IT_DO_NOT_LOAD into WA_DO_NOT_LOAD
WITH KEY WBS_Key = WA_SOURCE_PACKAGE-WBS_Key
BINARY SEARCH.
IF SY-SUBRC = 0.
IF ( WA_DO_NOT_LOAD-WBS_EXT = 'A' or WA_DO_NOT_LOAD-WBS_EXT = 'B' )
DELETE IT_SOURCE_PACKAGE INDEX V_SYTABIX.
ENDIF.
ENDIF.
ENDLOOP.
SOURCE_PACKAGE[] = IT_SOURCE_PACKAGE[].
ENDIF.
-Vikram -
Need a little help with Slimbox (Lightbox clone) and Spry data sets
Hello guys!
First of all let me say that I'm not a programmer in any way,
shape or form, and somehow I managed to build me a dynamic
thumbnail gallery that reads data from an XML file and displays it
on my webpage using a Spry data set and a slider widget (yay!)
This is of course only thanks to the many great examples
provided by the Adobe Spry team, and me being stubborn enough to
keep at it, even though I don't really understand what I'm doing :D
But I got to this point where I have basically everything
working, except that I can't get the Slimbox (Lightbox clone)
script to work with the Spry-generated thumbnail gallery.
From what I could understand from other threads on this
forum, is that I need to add an observer somewhere, only that I'm
not sure where and how (those threads are pretty old and the
examples aren't available anymore).
I'm sure you guys know what I'm talking about, anyway, here's
what I got so far:
http://www.riotdesign.com.ar/misc/gallery/test1.html
I have the thumbnail gallery populated from the external XML
file, a basic page navigation using the Sliding Panels widget, and
the Slimbox script which works only on the static test image.
Okay I guess that's it for now, sorry for the long post and
of course any help with this will be GREATLY appreciated :)
Thanks & bye!Kev,
Where exactly does the .evalScripts = true; text need to go?
Does it go in the href call?
<a href="ManageNotes.asp" title="Manage Notes" onClick="this.blur();
Modalbox.show(this.href, {title: 'Manage Notes', width: 575}); return false;">View your notes.</a>
Thanks for any assistance.
J Bishop -
Need a little help with RAF logic
So Im making a program to give different users, different rights. This is the method that appends them to file and Map
* Writes the players rights to the appendages
* @param playerName Player to update
* @param playerRights Rights to give the player
* @param pointer The lines index in the files
* @throws IOException If a read/write error occours
public void writeRights(String playerName, Rights playerRights, long pointer) throws IOException {
rightsRAF.seek(pointer);
rightsRAF.write(("\n" + playerName + "::" + playerRights).getBytes());
if(rightsRAF.read() != '\n') {
rightsRAF.seek(rightsRAF.getFilePointer()-1);
rightsRAF.write("\n".getBytes());
rightsMap.put(playerName, playerRights);
}1. The RAF goes to the predetermined index in the file, pointer, which is the line the users name starts on. Entries are stored in the file as "name::RIGHTS"
2.It writes out the players name, and rights
3. It checks to see if it accidentally wrote over the \n
My problem now, is that some rights are longer than others. For example, if there was already an entry, "name::MODERATOR" and you overwrite it, with "name::OWNER" then it would turn into "name::OWNERATOR" because the rest of the line wasn't overwritten.
I need some help with logic to determine how to overwrote the entire line, because sometimes you could go from a short one, to a long one, and need to append a new \n character, and sometimes you could go the other way around from long to short and end up with two words fused, I cant figure out how to determine whats a word that got partially overwritten and whats a new line totally.
ThanksAs pointed out you need to have fixed size records, or at least a maximum size.
You also have another problem nobody commented on yet (I don't think) with the getBytes() calls. At that point in your code you will mangle most unicode Strings.
All things being equal here I think your best solution is to use an embedded database like JavaDB with JDBC. I think you will find an XML solution to slow for your purposes.
If you decide to continue the RAF route though here is an example. I know this is not exactly what you are doing but you can extrapolate from this...
public void updatePlayerName(String playerName, int playerIndex){
int recordlength = 200;
byte[] buff = playerName.getBytes("UTF-8");
if(buff.length>recordlength){
//truncate bytes. this is also not great because a character at the end could be mangled
byte[] temp = new byte[recordlength];
System.arraycopy(buff,0,temp,0,temp.length);
buff = temp;
long pointer = playerIndex * (recordlength+4);// plus 4 bytes per record for actual length
raf.seek(pointer);
raf.writeInt(buff.length);
raf.write(buff);
public String getPlayerName(int playerindex){
int recordlength = 200;
long pointer = playerIndex * (recordlength+4);
raf.seek(pointer);
int lengthToRead = raf.readInt();
//length to read should be checked for sanity or bad things will happen next
byte[] buff = new byte[lengthToRead];
raf. readFully(buff);
return new String(buff,"UTF-8");
}And then of course you'd have to add storing the "rights". It gets complicated in a hurry. I do really recommend the JDBC route. -
Hi all, I’m having a little issue with After Effects. I’m a second year Computer Games Design Student and I’m in the process of wrapping up my various modules for the year.
One of my modules is 3D and animation, I’ve rendered my final animation out as PNG’s. There are enough to run at 24 frames a second to suit the 22 second audio clip. When I put the images into After Effects as a PNG sequence the sequence is only 18 seconds long, and renders out at 18 seconds.
I set the composition to 22 seconds long and made the frame rate 24 seconds when I first started the comp. I have a layer of the PNG’s ( The frames you’ll see) and a second layer of PNG’s (A Zdepth render from 3D Studio Max) to create a depth of field effect.
How do I get those PNG’s to render out at the speed I want? They always render out too quickly.
This will probably turn out to be something really simple, I apologise if it is! I tried looking online for other people asking, but I’ve got too many deadlines in the next week and can’t afford to spend time looking around. I’d greatly appreciate if someone could give me a hand.
Thank you.Make sure that you're interpreting the still-image sequence footage item at the right frame rate. Read this page.
-
A little help with my first 2 column liquid hybrid effort.
Hello all:
I am attempting my first liquid hybrid layout using DW's "2 column hybrid, left column, header, footer". layout and it's going pretty good but... I can't seem to get rid of the black line just below the top area that contains the two samle graphics. I believe it may be an gap between the "topcontainer" div and the "container" div below it. I just can't figure out how to fix it.
Here's a link to show you what I am trying to accomplish. http://reynolds-marketing.com/twotest/atest.html
Attached are the html and css files.
Any suggestions would be very much appreciated. TIA!Hi
No, that is what I was expecting.
You will have to use IE conditional comments (also called conditional statements), they go just above the closing </head> in your html or place the IE only css in a separate css file (what I normally do), and link to them inside the IECC in your html file.
My previous suggestions apply for correcting the problem, and for IECC usage see - http://www.quirksmode.org/css/condcom.html,
(use initially)
<!--[if IE]>
I get nothing for the following, but -
Have you checked out the 'css anthology' book from sitepoint, as this will help with such problems, see the post from Nadia - http://forums.adobe.com/thread/497065?tstart=0, these are an excellent help (and on offer at the moment), I can personally recommend the "Everything you know about css is wrong" book, especially once you are happy creating 'standard' css layouts, and there is a plug-in for IE6 & 7 to enable the css layout mode it discusses.
PZ -
Need a little help with some errors.
Receiving some errors..
btn2.addActionListener(new ActionListener() {
and also
frame.setLocation(400,400);
frame.setVisible(true);
}<<~~has 2 errors here...
Both above have class or interface expected errors..clueless on what i'm missing at the moment.
Anyone mind pointing out what {'s and }'s i'm missing?
btn1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
btn1actions();
private void btn1actions() {
if (radio1.isSelected()) System.out.println("Radio Button 1 is selected.");
if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.");
btn2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
btn2actions();
private void btn2actions() {
if (radio1.isSelected()) System.out.println("Radio Button 1 is selected.");
if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.");
btn3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
btn1actions();
private void btn3actions() {
txt1.setText("");
txt1.requestFocus();
public static void main(String[] args) {
Test2 frame = new Test2();
frame.setTitle("Test Frame");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400, 300);
frame.setLocation(400,400);
frame.setVisible(true);
}All my code..finally posted...just need help with more errors.
F:\DocumentsTest2.java:169: ';' expected
btn1.addActionListener(new ActionListener()) {
^
F:\Documents\Test2.java:176: illegal start of expression
private void btn1actions() {
^
F:\Documents\Test2.java:191: illegal start of expression
private void btn2actions() {
^
F:\Documents\.java:202: illegal start of expression
private void btn3actions() {
^
4 errors
Tool completed with exit code 1
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Test2 extends JFrame{
static JButton btn1,btn2,btn3;
static JTextField txt1;
static JRadioButton radio1,radio2;
public Test2() {
Container container = getContentPane();
container.setLayout(new BorderLayout());
//Create Panels
JPanel Panel1 = new JPanel();
JPanel Panel2 = new JPanel();
JPanel Panel3 = new JPanel();
JPanel Panel4 = new JPanel();
JPanel Panel5 = new JPanel();
JPanel Panel6 = new JPanel();
JPanel Panel7 = new JPanel();
JPanel Panel8 = new JPanel();
JPanel Panel9 = new JPanel();
JPanel Panel10 = new JPanel();
//Set Layout for Panels
Panel3.setLayout(new BorderLayout());
Panel4.setLayout(new BorderLayout());
Panel5.setLayout(new BorderLayout());
Panel6.setLayout(new BorderLayout());
Panel10.setLayout(new BorderLayout());
//Create the Various Fonts and Colors for this GUI
Font font1 = new Font("SansSerif", Font.BOLD, 20);
Font font2 = new Font("Serif", Font.PLAIN, 15);
Color color1 = new Color(3,15,125);//A Dark Blue Color
Color color2 = new Color(201,29,10);//A Red Color
Color color3 = new Color(127,127,127);//A Grey Color
//Create Buttons and Labels
btn1 = new JButton("Submit");
btn2 = new JButton("Display Schedule");
btn3 = new JButton("Enter New Name");
JLabel label1 = new JLabel("Student Name");
JLabel label2 = new JLabel("Course Number");
JLabel label3 = new JLabel("Welcome to the Java Community College");
JLabel label4 = new JLabel("Registration System!");
//Declare Text Field For Entering Student Names
txt1 = new JTextField(15);
//"Put Course Number from another Method Here"
String[] courseStrings = { "CISM2230 A", "CISM2230 B", "CISM1110 A", "CISM1110 B", "CISM1120 A", "CISM1120 B" };
JComboBox Combo1 = new JComboBox(courseStrings);
//Declare Radio Buttons for Add and Drop Course
radio1 = new JRadioButton("Add a Course", false);
radio2 = new JRadioButton("Drop a Course", false);
ButtonGroup radioButtons = new ButtonGroup();
radioButtons.add(radio1);
radioButtons.add(radio2);
//Panel 10 is the Main Displaying Panel
Panel10.add(Panel3, BorderLayout.NORTH);
Panel10.add(Panel4, BorderLayout.CENTER);
Panel10.add(Panel8, BorderLayout.SOUTH);
//Panel 3 Used to Display Label 3 and 4 using Panels 1 and 2
Panel3.add(Panel1, BorderLayout.NORTH);
Panel3.add(Panel2, BorderLayout.CENTER);
Panel1.add(label3);
Panel2.add(label4);
//Panel 4 Used to Display Student Name, Txt1, Course Number, Combo Box and Radio Buttons
Panel5.add(label1, BorderLayout.NORTH);
Panel5.add(txt1, BorderLayout.CENTER);
Panel6.add(label2, BorderLayout.NORTH);
Panel6.add(Combo1, BorderLayout.CENTER);
Panel7.add(radio1, BorderLayout.NORTH);
Panel7.add(radio2, BorderLayout.CENTER);
Panel4.add(Panel5, BorderLayout.NORTH);
Panel4.add(Panel6, BorderLayout.CENTER);
Panel4.add(Panel7, BorderLayout.SOUTH);
//Panel 8 Used to Display the Buttons
Panel9.add(btn1, BorderLayout.CENTER);
Panel9.add(btn2, BorderLayout.CENTER);
Panel9.add(btn3, BorderLayout.SOUTH);
Panel8.add(Panel9, BorderLayout.CENTER);
//Setting Background, ForeGround and Font of all Text.
Panel1.setBackground(color3);
Panel2.setBackground(color3);
Panel3.setBackground(color3);
Panel4.setBackground(color3);
Panel5.setBackground(color3);
Panel6.setBackground(color3);
Panel7.setBackground(color3);
Panel8.setBackground(color3);
Panel9.setBackground(color3);
Panel10.setBackground(color3);
btn1.setBackground(color3);
btn2.setBackground(color3);
btn3.setBackground(color3);
radio1.setBackground(color3);
radio2.setBackground(color3);
btn1.setFont(font2);
btn2.setFont(font2);
btn3.setFont(font2);
Combo1.setFont(font2);
Combo1.setBackground(color3);
Combo1.setForeground(color1);
label1.setFont(font2);
label2.setFont(font2);
label3.setFont(font1);
label4.setFont(font1);
label1.setForeground(color2);
label2.setForeground(color2);
label3.setForeground(color1);
label4.setForeground(color1);
container.add(Panel10);
//Setting Keyboard Shortcuts to Radio Buttons and Regular Buttons
btn1.setMnemonic('S');
btn2.setMnemonic('D');
btn3.setMnemonic('E');
radio1.setMnemonic('A');
radio2.setMnemonic('C');
//ActionListener
btn1.addActionListener(new ActionListener()) {
public void actionPerformed(ActionEvent evt) {
btn1actions();
private void btn1actions() {
if (radio1.isSelected()){ System.out.println("Radio Button 1 is selected. Button 1")};
if (radio2.isSelected()){ System.out.println("Radio Button 2 is selected. Button 1")};
btn2.addActionListener(new ActionListener()) {
public void actionPerformed(ActionEvent evt) {
btn2actions();
private void btn2actions() {
if (radio1.isSelected()) System.out.println("Radio Button 1 is selected(Button 2).");
if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.Button 2");
btn3.addActionListener(new ActionListener()) {
public void actionPerformed(ActionEvent evt) {
btn1actions();
private void btn3actions() {
txt1.setText("");
txt1.requestFocus();
public static void main(String[] args) {
JavaCollegeTest2 frame = new JavaCollegeTest2();
frame.setTitle("Project 4");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400, 300);
frame.setLocation(400,400);
frame.setVisible(true);
} -
Need a little help with an animated JButton.
I have a nice little button that on mouse entry runs a morf animation from one picture to another then stops.
On leaving the button it runs the animation in reverse. The animation is done with two GIF images loaded as
Icons using ImageIcon. Now this looks really nice, BUT it only dose it the first time the button is entered
and the first time the button is exited. After this is abruptly switches from the "un-entered" button icon to the
"entered" button icon (the end frame of the respective GIF animation's). I originally tried using the
setRolloverIcon etc. When that did not work I thought that I would be able to get the images to be loaded
each time by adding a MouseListener and using the mousePressed, mouseReleased, mouseEntered,
mouseExited etc. methods. This gives me the situation described above. In the MouseListener methods a
line like the following is used:
((JButton) e.getSource()).setIcon (new ImageIcon (MainWindow.
class.getResource ("images/selected.gif")));
How can I get the Button to run the animation every time it is entered | exited? The GIF from which the
icons are made are set to run the animation through once, not an end less loop which would not be the
desired effect.
Any suggestions would be great
Thank you
M Pratten.Well I guess I should of just kept trying "lunch helps".
Any way to get the image to reanimate each time the mouse pointer enters leaves the button I changed the
code in the mouseListener to something like:
ImageIcon i = new ImageIcon (MainWindow.class.getResource ("images/selected.gif"));
i.getImage().flush ();
((JButton) e.getSource()).setIcon (i);
I am assuming the flush puts the GIF animation back at its first frame so it has to redo the animation, which is
exactly what I want.
Now if any of the local experts know of a better way of doing this I would be happy to hear about it. But at
the moment it seems to work just fine.
Thanks to those that read my post.
M Pratten. -
Ok guys I need help, here is what I want to happen. I want the script to just shorten a movie file. It should be so simple!!
lengthofmovie = film length
set time range from 0 to (lengthofmovie-1)
save the movie as a new file
That is all I want done, I am ripping my hair out of my head trying to do this. Please help me!!
Here is my code so far:
with timeout of 86400 seconds
display dialog "Before beginning batch processing, make sure QuickTime Player is set to the desired export settings, and all videos to be processed are in a folder named ‘Input’ on the desktop." with icon note
tell application "Finder"
set the startup_disk to the name of the startup disk
end tell
set user to do shell script "whoami"
set inputfoldername to "Input"
set input_folder to startup_disk & ":Users:" & user & ":Desktop:" & inputfoldername & ":"
set user_desktop to startup_disk & ":Users:" & user & ":Desktop:"
set output_folder to startup_disk & ":Users:" & user & ":Desktop:Output:"
set file_extension to "_export.mp4"
try
tell application "Finder"
make new folder at user_desktop with properties {name:"Output"}
end tell
end try
try
set thefolderlist to list folder input_folder without invisibles
repeat with x from 1 to count of thefolderlist
set the_file to input_folder & item x of thefolderlist
set output_file to output_folder & item x of thefolderlist & file_extension
tell application "QuickTime Player"
activate
open the_file
//change timeline, trim NEED HELP HERE
export front document to output_file as MPEG4 using most recent settings with replacing
close front document
end tell
end repeat
on error
display dialog "This script requires a folder named ‘" & inputfoldername & "‘ located on the desktop." with icon stop
end try
beep
end timeoutHi plashd,
First, I must confess that I don't know much about QuickTime. Nevertheless, while trying to understand your problem, I discovered that the AppleScript dictionaries of QuickTime Player and QuickTime 7 were very different from one another, and was unable to use the “export” command of QuickTime Player. However, I finally was able, with the following script, to use AppleScript to shorten a QuickTime movie and save it under another name:
*set the_file to POSIX file "/Users/pierre/Desktop/MVI_0503.MOV"*
*set output_file to "/Users/pierre/Desktop/NewMVI0503.MOV"*
*tell application "QuickTime Player"*
activate
*open the_file*
*tell front document*
*trim from 1 to (duration - 5)*
*save in output_file with replacing*
*close without saving*
*end tell*
*end tell*
Hope it can help. -
Encrypted MAPI on WAAS 5.0.3a I need a little help with troubleshooting
So, I stumbled upon this portion of the 5.0.1 configuration guide that spells out step by step how to configure encrypted mapi acceleration:
http://www.cisco.com/en/US/docs/app_ntwk_services/waas/waas/v501/configuration/guide/policy.html#wp1260556
1. Configure DNS settings - Done
2. Configure NTP settings - Done
3. Verify WAE devices are registered and online with the WAAS Central Manager - Done
4. Configure SSL Peering Service - Did this, seems to be working, but it would be great if someone could provide me with some show commands that will verify this is configured properly.
5. Verify WAN Secure mode is enabled - Did this, but the command "show accelerator wansecure" shows it is enabled and running, but seems like useless information, anyone know any better commands to verify this? No tcp session are coming up wansecure...
6. Configure windows domain settings and perform domain join - I did this on the Data Center WAE-674 only, the computer account was created in the domain.
7. Configure domain identities - Ok, I was a little confused here, but I used the machine account name that I created in the previous step, seems to be working, the lack of explanation/troubleshooting at this point is very frustrating. The image shown uses a different name than the device name in the picture...
8. Enable Windows Domain Encrypted Service - Done, very strait forward
9. Enable Encrypted MAPI Traffic Optimization - Done, also very strait forward
So, from the WAE, I run the command "show stat conn" I still see the TG connections with 0.00% to the mail server. Called user, had them exit from (and I verified session closed) and reconnect to exchange, still TG 0.00%. Not sure if this one was useful or not, but "show stat conn | inc W" no sessions with W.
I did find that this command "show windows-domain encryption-service keylist" seems to be the most useful (even though I didn't find it on any Cisco support page, found it by stumbling through available commands, trying each one in turn) showing the two requests to the two exchange servers were successful. Which makes me think I did something right, who knows exactly what since the EMAPI is still not decrypted.
I have no errors showing on the CM Management console. I did have some errors pop up when I was generating the self signed certificates, but they all cleared when I finished all the devices. I am going to reboot the WAE tonight and see if things start picking up tomorrow or if I get any errors after reboot.
I am hoping that someone has some good show commands or debug commands that will point to where or what the problem is.Ok, I got it working. Well, it is meeting the criteria I specified above anyway.
1. to verify your SSL is working properly: "show crypto ssl services host peering"
2. Wansecure is enabled/disabled, there is no verification, very strait forward.
3. DO use the computer account you create when you join the domain as the machine account.
Show commands to verify you did everything correctly:
"accelerator mapi verify encryption-settings"
"show windows-domain encryption-service keylist"
If you did everything correctly, you should get keys from the exchange server(s).
Now, the issue I ran into. Our 2 exchange servers are both behind a Citrix Netscaler for load balancing. If a user connects directly to the exchange servers, it works, if they connect to the netscaler, it fails to accelerate. I can not get a key from the netscaler, not sure if there is a way to manually exchange keys and force the to devices to trust each other. Anyone who may have seen this, your help would be greatly appreciated.
Just to clarify, MAPI acceleration works fine through the netscaler, it is just the EMAPI that fails. EMAPI and MAPI both work fine through exchange, but then I lose the load balancing the netscaler provides. -
Need a Little Help with Understanding How Layers Work in PSE
I have PSE version 5 and I am using it on a PC with Windows XP.
As I get more into editing photos, I am enjoying it, but confusion is also starting to set in. My question is about layers. When I go to edit a photo for web/email use only, I start by resizing it to 72 ppi and then reducing the pixel dimensions quite a bit. Then after that I normally go through this process of editing the photos by using normally about three different commands. One is Levels, then I may go to Shadows/Highlights, and then my last command is always sharpening. I used to do this all on one layer, but then finally learned to put each one of these editing features on their own layer so I can make changes/deletions without too much trouble.
When I started doing the separate layers, I was just making a copy of the background layer each time and then touching that particulay layer up with Levels, Sharpen or Shadows/Highlights. But I noticed that depending on the order in which the layers were placed, some changes would be obscured. If I put the Levels layer on top, and then the Sharpen layer and the Shadows/Highlight layer below that, the sharpen effect and the shadows/highlights effects were no longer there. I could only see the levels effect. The photo was still not sharp and so on. If I put the Sharpen level on top, then the photo showed the sharpen effects, but now the Levels and Shadows/Highlights effects were no longer visible.
So then I started to make a copy of the background initially, do a levels adjustment here, then, instead of making a copy of the original background layer again, I would make a copy of the layer that now has the levels changes on it. Then do the sharpen effect on this layer. This way I had all the changes on one layer as long as I put that layer as the top layer. But then I realized that I once again fI didn't have a layer with only one fix on it. Finally, I started to use an adjustment layer for Levels, put this as the top layer, make a copy of the background layer, do shadows/highlights, copy background layer again, do sharpen, and this seems to work a little better. But even with this way, depending on what order I place the sharpen and shadows/Highlights layers, one of them still seems to get obscured by the layer above it.
Can someone help me to understand how layers work in this regard. I am obviously a little confused here.
Thanks,
LeeYou really aren't working efficiently. First of all, do your editing on a full sized version of the photo, since you have more data for PSE to work on and will get better results. Use save for web to make your web/email copy when you are totally done. You can resize it down on the right side of the save for web window.
Duplicating a regular layer makes an opaque layer that obscures the layers below it. It's best to start off by not working on your original image, so that you don't have to worry if you mess up. If you're working on a copy, you can work right on the background layer, or only duplicate the layer once and apply your changes to that. So you'd apply both shadows/highlights and sharpening to the same layer.
Finally, you should use an adjustment layer for levels. Layer>New Adjustment Layer>Levels. This will put levels on a transparent layer above your image, but you will need to click the layer below it to get back to a pixel layer to apply other changes (you can't sharpen an adjustment layer, for example).
Maybe you are looking for
-
How can i type a foreign language in fireworks cs3?
Hi, I am trying to type in some Indian languages - Hindi, Kannda, etc. on my Fireworks file. I am simply using Google Transliterate to generate the text, then copying and pasting on to FW (CS3). But the text appears badly formatted - not completely g
-
My iPod date is dec 31 1969. Have not used in a long time cannot get it to do anything
Need help to update phone
-
Validator not returning the results.
Hi All, I have extended the StringValidator class in order the create a username validator. When a new user is being registered, the username is validated on the server to check if it exists. The code is not throwing errors and i know the remoteobjec
-
RAID 1 is not showing in UCS Server configuration utility
Hi, I have a UCS Server C200 M2 Rack Mount and planning to install Windows 2008 R2 server in it. To make it High Available, i m configuring RAID 1 in it. I can easily configure RAID from BIOS setup and after rebooting it shows me that the RAID 1 is f
-
Whitelist COMPAQ 610-VC388E​S
Hi, i need to change my wireless card for incompatibility with my linux how can i do? what's the last bios? how can deactivate whitelist