Simple AppleScript Problem
I have two scripts to watch folders for files and open in a particular application.
The problem is Script 1 will delve into subfolders to grab files, but Script 2 won't!
Script 1
on adding folder items to thisFolder after receiving addedItems
repeat with movieFile in addedItems
tell application "iFlicks"
import movieFile with gui
end tell
end repeat
end adding folder items to
Script 2
on adding folder items to thisFolder after receiving addedItems
repeat with movieFile in addedItems
if name of (info for movieFile) ends with ".mkv" then
tell application "iFlicks"
import movieFile as QuickTime movie without gui
end tell
else if name of (info for movieFile) ends with ".avi" then
tell application "iFlicks"
import movieFile as Apple TV 2 video without gui
end tell
end if
end repeat
end adding folder items to
Can someone please point out what I'm doing wrong? Thanks!
wrong is maybe not the right term. the problem is that iFlicks (apparently) can extract folder contents when you do not specify a particular format, but won't do it when you do. That's something you should probably tell the developer of iFlicks about.
Similar Messages
-
Simple Applescript Dialog Box Issue
Hi,
I am writing a very simple applescript that sets a variable to some text entered by the user in a textbox, in a dialog. Unfortunately, the font that is used to display what the user types is virtually unreadable, and therefore not at all fit for the purpose.
I have recently had some problems with my system font cage, that required an entire re-install of the operating system, when I downloaded the new Microsoft Office 2011, but that issue has been resolved, and I can not see how it would effect applescript.
Is there any way that I can change the font that is displayed as the user enters text. A photo of the dialog at the moment can be seen here:
[img]http://www.freeimagehosting.net/uploads/b5102a5dd2.png[/img]
Thanks for any help you can give me,
Arilooks like a system font has been replaced by another....
you could try to check/repair your fonts using apple's font book.app... already tried it?
open it up, select all fonts (cmd+a) and select check fonts from the menu... -
Real simple xslt problem/question
Hi, i have a real simple xslt problem but i just cant figure out how to do it by looking at various examples on the net. i have a xml document and in it are some elements with a "result" tag name. i want to use xslt to reproduce exactly the same xml document except with an attribute called "id" added to those elements with a "result" tag name. i'm sure that theres a simple solution to it but i just cant figure it out. any helps greatly appreciated, thanks
Start with the XSLT identity transform (I don't have it handy and it's fairly long, but you should be able to google it up). Add this:<xsl:template match="result">
<result id="">
<xsl:apply-templates>
</result>
</xsl:template> -
JDeveloper IDE simple setting problem
Hi,
Recently we switched to JDeveloper from Visual Cafe .I have a simple setting problem.How can I set the options so that IDE gives, the core java classes and packages,and our application classes and packeges, prompts in imports as well as in code.Where to set the options.
eg: when I write
import java. it should prompt all the pakages.
Thanks in advance.
-Gopal
nullI am not sure I understand what you are requesting, but ...
You can configure JDeveloper projects to include various libraries by default.
This is done by selecting menu Tools | Default Project Properties.../ Libraries tab.
You should define a library for your classes.
You can import any of the packages / classes from all the libraries which your project includes.
It would be incorrect for a tool to automatically add a bunch of import lines at the top of every file because each file should import what it needs and just as importantly, not import what it does not need depending on the component type (e.g. a servlet should not include javax.swing.* ).
An easy way to import elements into JDeveloper is to type in something like:
import java.
// and then type in Ctrl Space
and this launches the package browser, you can select packages or classes to import.
You can also do this at the variable declaratiton point such as typing in:
foo() {
Frame x
// Press Control Alt Space
and this will correctly change the type (Frame) to the type you select in the package browser and add the import statement.
-John
null -
Simple OOP Problem. Help!
This is just a simple OOP problem that i cant decide on a best
implementation for.
im passing an object to an instance of, 'TabbedFrame', which is just
a frame with a Tabbed Pane in it that is holding custom panels.
however, these custom panels need access to the object being
passed to 'TabbedFrame' and to some methods in it.
i cant make them static however so how do i gain access to them?
is my only option to pass the 'TabbedFrame' to each panel?
like - jtabbedpane.add( "Panel 1", new mypanel1(this));
here is code:
new TabbedFrame( DataObject );
public class TabbedFrame{
public TabbedFrame(DataObject do){
this.do = do;
jtabbedpane.add( "Panel 1", new mypanel1() );
DataObject do;
public class mypanel1{
public mypanel1(){
// need access to DataObject of the 'TabbedFrame' object that instantiated
// this 'mypanel1' and to some of its methods
}i would just pass the DataObject to evey panel (there are 12) but
i also need to be able to call methods in the 'TabbedFrame'.
Any help would be appreciated!Modify mypanel1's constructor:
public class mypanel1{
TabbedFrame tf;
public mypanel1(TabbedFrame tf){
this.tf = tf;
// need access to DataObject of the 'TabbedFrame' object that instantiated
// this 'mypanel1' and to some of its methods
DataObject theDo = tf.getDataObject();
tf.someMethod(); // Call method on the TabbedFrame
}In TabbedFrame:
public TabbedFrame(DataObject do){
this.do = do;
// Modify call to constructor to pass "this" TabbedFrame.
jtabbedpane.add( "Panel 1", new mypanel1(this) );
} -
Help to create simple Applescript
Hi, hopefully somebody will be able to help me with a simple Applescript.
I want to be able to drag a pdf file onto a desktop icon, enter a new filename into a dialogue box and for the file to be copied to a specific folder. It will only be pdf files, and I want it to automatically append the .pdf extension.
Could sombody possibly point me in the right direction? Thanks in advance.Oops, forgot one more check. If a file exists with the same name as the original file, then it will error when you duplicate it. One way to solve that is to duplicate in place. Then "copy" is added to the name. You then move the file to the destination folder and probably there is no file with "copy" in its name.
property folder_location : (path to desktop)
property folder_name : "Files"
on open these_items
-- added check for main folder
tell application "Finder"
try
set main_folder to (folder folder_name of folder_location) as alias
on error
set main_folder to (make new folder at folder_location with properties ¬
{name:folder_name})
end try
end tell
repeat with this_item in these_items
set n to name of (info for this_item)
if n ends with ".pdf" then
set temp_prompt to "Enter a name for duplicate of " & n & ":"
repeat
display dialog temp_prompt default answer "name"
set new_name to (text returned of result) & ".pdf"
tell application "Finder"
if not (exists file new_name of main_folder) then
set the_duplicate to (duplicate this_item) as alias
move the_duplicate to main_folder
set name of the_duplicate to new_name
exit repeat
else -- inform user to enter a different name
set temp_prompt to "Enter a different name. The name " & new_name & " is used."
end if
end tell
end repeat
end if
end repeat
end open
Otherwise, What I usually do is create a empty temp folder for doing renaming, but then it gets more complicated. For now, just don't use "copy" in names.
gl, -
Converting simple AppleScript to JavaScript
Hello to all,
I need to convert a simple AppleScript to JavaScript, but as I don't know one bit about JavaScript, is there anyone willing to help me out ?
Here is the AppleScript:
tell application "Adobe Photoshop CS5"
activate
set display dialogs to never
set thisdoc to current document
tell thisdoc
resize image resolution 300 resample method none
end tell
end tell
Very simple script to resize some low-res pictures without touching final resolution.
Thanks !This will change the resolution only..
app.displayDialogs = DialogModes.NO;
activeDocument.resizeImage(undefined, undefined, 300, ResampleMethod.NONE); -
Simple AppleScript to export Mail messages to FileMaker DB?
Hello everyone,
I'm using a product called "Mail Archiver X" to archive messages from Apple Mail into a custom FileMaker database ("eMailViewerX" - this is the target database that comes with Mail Archiver and is required for the process), from where I copy these messages to my main message archive (another FileMaker DB).
While that process works, it is kind of clumsy (Apple Mail > Mail Archiver X > FileMaker DB #1 > FileMaker DB #2) - and it breaks every time when there is a new version of Apple Mail or OS X until "Mail Archiver X" has been updated by the developer.
So I'm looking for a more simple solution: an AppleScript that will export all messages from exactly one folder ("To Archive") in Apple Mail (4.5/Snow Leopard or 5.0/Lion) as a simple CSV or .tab file, with the following data per line:
Message Sender*
Message Receiver*
Sent Date
Sent Time
Subject
Body
* Separation of name and e-mail address would be cool, but I understand this may not (always) be possible.
The only tricky part may be the conversion of carriage returns in the e-mail messages' body into the special character FileMaker expects in TAB or CSV files. In BBEdit, this is shown as \x{0B} (UTF8: 0B). So there would have to be a Find/Replace for that in the script.
This does not have to be free (although I wouldn't mind - I'd gladly pay for something that is simple and reliable.
If someone knows about such a script or is willing to write it, I would really appreciate it.
TL;DR: I want to export all messages from an Apple Mail folder to a FileMaker-readable CSV file.You haven't fully specified the problem:
It's not clear what to do when there are multiple recipients of an email
You didn't say precisely what Filemaker fields you wanted in the file, nor what order you wanted them in, nor whether you needed a header row in the text file
That being said, what you want is a script somewhat like the following (with many things still needing to be adjusted):
set archiveFolder to "To Archive"
set tab_delFilePath to "Path:to:tab_del file"
set tab_delText to {}
tell application "Mail"
set messagesToArchive to every message of mailbox archiveFolder
repeat with thisMessage in messagesToArchive
set thisEntry to {}
tell thisMessage
set {itsSender, itsRecipients, itsDate, itsSubject, itsText} to {sender, recipients, date received, subject, content}
set {senderName, senderAddress} to {extract name from sender, extract address from sender}
if senderName = senderAddress then set senderName to ""
-- get date parts
set itsDateString to short date string of itsDate
set itsTimeString to time string of itsDate
-- there may be multiple recipients; create list
set {recipientName, recipientAddress} to {{}, {}}
repeat with thisRecipient in recipients
tell thisRecipient
set recipientName's end to name
set recipientAddress's end to address
end tell
end repeat
-- convert carriage returns to linefeeds in message body; unicode 0B is ascii 11, which is linfeed
set itText to my tid(my tid(itsText, return), linefeed)
set thisEntry to {senderName, senderAddress, itsDateString, itsTimeString, itsSubject, my tid(recipientName, ","), my tid(recipientAddress, ","), itsText}
end tell
set end of tab_delText to my tid(thisEntry, tab)
end repeat
end tell
set tab_delText to tid(tab_delText, return)
set fp to open for access tab_delFilePath with write permission
write tab_delText to fp
close access fp
on tid(input, delim)
-- a subroutine for handling text item delimiters
set {oldTID, my text item delimiters} to {my text item delimiters, delim}
if class of input is list then
set output to input as text
else
set output to text items of input
end if
set my text item delimiters to oldTID
return output
end tid
it's a place to start, anyway.
If you want to dangle money in front of my eyes, send me an email and I'll get it set up properly on your system (including automating the process and importing the data directly into your filemaker database). -
I am having a real problem creating a simple button - I have
created a Flash file using Action script 2, and when I create a
simple button - text with a rectangle as a background, (see
http://www.elkhavenestate.com),
and the over state is behaving in a bizarre fashion. This is my
first time using CS3, so is there a new control that I'm
missing?I take it that it's the Home button. It appears to have a
selectable text field or something in it, which is causing the
problem. Either change that to a static text field or set its
selectable property to false. The other two buttons appear to be
fine, so maybe you can just duplicate one of them and turn it into
the Home button.
If I picked the wrong button, let me know. -
Help with a simple applescript for combining Artist text with Track name
Hi all,
I'd like to put together a simple script that takes the artist names from a list of tracks in iTunes and copies the text to the start of the Title name, followed by " - ".
This is because, e.g. on a classical album, I want the artist names to all be "Classic Collection Gold" but I'd like to keep the artist name contained with the track name. This means when I browse by artist I don't get millions of artists...
I found this script, which does something kinda similar, but I'm new to script writing so not sure how to do it?
So I'd like to change:
Name
Planets: Mars
Artist
Gustav Holst
Ambum:
Simply Classical Gold (Disc 2)
To be:
Gustav Holst - Planets: Mars
Artist
Gustav Holst - Planets: Mars OR BETTER Simply Classical Gold (Disc 2)
Album
Simply Classical Gold (Disc 2)
This script has some ideas in, but I'm not sure how to tweak it....
"Artist - Name Corrector" for iTunes
written by Doug Adams
[email protected]
v1.6 May 17, 2004
-- removed ref to selection
v1.5 April 11 2004
checks if separator string is in name
v1.0 April 2 2004
Get more free AppleScripts and info on writing your own
at Doug's AppleScripts for iTunes
http://www.malcolmadams.com/itunes/
property separator : " - "
tell application "iTunes"
if selection is not {} then
set sel to selection
repeat with aTrack in sel
tell aTrack
if (get name) contains separator then
set {artist, name} to my texttolist(get name, separator)
end if
end tell
end repeat
end if
end tell
-- == == == == == == == == == == == == == == == ==
on texttolist(txt, delim)
set saveD to AppleScript's text item delimiters
try
set AppleScript's text item delimiters to {delim}
set theList to every text item of txt
on error errStr number errNum
set AppleScript's text item delimiters to saveD
error errStr number errNum
end try
set AppleScript's text item delimiters to saveD
return (theList)
end texttolist
Message was edited by: ChipstixI'm not sure what that script thinks it's doing, but it's essentially doing nothing, so scrub that and start afresh.
The first thing you need is a way to identify the tracks to change - you don't want to do all tracks in the library (they might have already been munged). A good option is to work on the selected tracks:
tell application "iTunes"
if selection is not {} then
set sel to selection
You then need to iterate through those items, changing them one-by-one:
repeat with aTrack in sel
Now comes the easy part - build a list of the elements you want (in this case you want the name, artist, and album of each track:
set trackName to name of aTrack
set trackArtist to artist of aTrack
set trackAlbum to album of aTrack
Now you have the information you need, so reset the fields as appropriate:
set name of aTrack to trackArtist & " - " & trackName
set artist of aTrack to trackAlbum -- or to trackArtist & " - " & trackName, depending on your choice
Now clean up by closing off the repeat and tell blocks:
end repeat
end tell
Putting it all together you get:
tell application "iTunes"
if selection is not {} then
set sel to selection
repeat with aTrack in sel
set trackName to name of aTrack
set trackArtist to artist of aTrack
set trackAlbum to album of aTrack
set name of aTrack to trackArtist & " - " & trackName
set artist of aTrack to trackAlbum -- or to trackArtist & " - " & trackName, depending on your choice
end repeat
end tell -
Logo/picture to menubar? simple css problem?
Hi, I'm having a problem getting a logo to appear correctly in a horizontal menu bar. It appears to be fine in IE 8, Safari 5, Chrome, and Firefox. However in IE 7 and lower it does not seem to display correctly. The only conditional notes I have for IE 7 and lower deals with the slideshow on the page which shouldn't be affecting the menubar as it is in a different div.
Here is the url: www.elementcentral.com
Any advice? I could really use some help- I've tried quite a few things but to no avail...
Thanks for any help you can offer and I'm more than happy to clarify or anything else!
Sincerely,
MattAnyone? I'm thinking its just something simple but I can't figure it out for the life of me heh.
-
I'm dabbling with DLL writing and can't figure out how to pass a string to a
DLL. As far as I can see, it should be simple.
My DLL function, in the DLL "test.dll", is simply
TEST_API int test(LPCTSTR WinName)
return 0;
Instead of LPCTSTR I've also tried the more conventional "char *WinName",
and a few others. All give the same error; "The exception Priviledged
Instruction occurred in the application at location (blah)." The error
message doesn't seem too specific; exactly the same thing happens if I
deliberately copy some text to an uninitialised pointer.
I'm calling the function using a "Call Library Node", passing a
pre-generated string in the form of a C string pointer. The calling
convention is set to "winapi" but doesn't seem too relevant.
If I remove the string argument and change the function definition to take
(void) then it works, in that I can put integers in the return code and pass
them back to Labview, so it's the passing of the string that's the problem.
However, if I have more code in there and I use the Visual C++ debugger, the
error message is only generated on hitting the "return" line, and I can see
the string that has been passed in when I look at "WinName" in the debugger.
Can anyone shed some light on this?
Craig Graham
Physicist/Labview Programmer
Lancaster University, UKCraig;
I am going to throw some random thoughts that may help you in your situation:
- I avoid to use VC's wizard. It gives (and gave me) a lot of headaches. All it does it to add a lot of garbage to your project that nobody understand.
- If your source file is a .cpp, wrap your function prototypes inside the extern "C" declaration.
- Always initialize every variable in LabVIEW side. For example, for your function you should wire an empty string in the input side of the "Call Library Node" for the "WinName" variable.
- I claim ignorance in this one, but seems to simplify my projects. Exclude rarely-used Windows header files by adding the following statement before your headers "include":
#define VC_EXTRALEAN
I hope this can be of help. If I co
me up with some more suggestion, I'll let you know.
Best regards;
Enrique
www.vartortech.com -
Another simple classpath problem question
Hi All
Yes I know, there are a lots of questions about this matter, but I couldn't found a solution to my problem.
I have a simple program:
public class prueba {
public static void main(String[] args) {
System.out.println("Ahi va...");
}placed in /tmp/javier/prueba.java
After compiled, I've tried to run it from / and then problems started:
cd /
java /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
I said, ok...it could be a classpath problem...then:
java -cp /tmp/javier/ /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba
Damn, another try...
java -cp .:/tmp/javier/ /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
Jesus Christ....may be the last slash....
java -cp .:/tmp/javier /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
Oh...no.... may be classpath to java classes..
java -cp .:/usr/java/j2sdk1.4.2_01/lib/jre/:/tmp/javier/ /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
Well, I don't know why this error happens....
Please, could somebody help me !!!
Thanks in advance...
<jl>It's not too early to start following the Sun coding
conventions for Java:
http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.
tmlHi
thanks for your reply.
Yes, I agree. I use conventions with my programs. But my real problem was with a real application and then I did quickly this simple code to help others to understand the problem and give a fast reply...
Let me know if that works. (It was fine on my
machine.) - MODYes it works fine, thanks.... and Damn...Murphys law again, the only option I didn't tried is the solution to my problem... :)
Thanks again... -
The problem is very simple,
I have several forms on my site such as the 'quick enquiry'
form on the home page about half way down.
http://www.party-invitation.co.uk/index.htm
The user enters name- Works Fine
user enters email address- Works Fine
User enters a question- This is were the problem occurs when
the users presses the Enter key. This seems to bring up a message
that says Invalid Input.
Does anyone know how i can allow people to use the Enter key
in my forms to skip lines without causing this error message?
Any help would be appreciated.
Feel free to use the form to test it out.
Thanks.
Here is my php code for the form.
<?
function checkOK($field)
if (eregi("\r",$field) || eregi("\n",$field)){
die("Invalid Input!");
$Name=$_POST['Name'];
checkOK($Name);
$Email=$_POST['Email'];
checkOK($Email);
$Question=$_POST['Question'];
checkOK($Question);
$to="[email protected]";
$message="
A Quick Enquiry has been submitted from
www.Party-Invitation.co.uk
Here are the details:
Name: $Name
Email: $Email
Question: $Question
if(mail($to,"Quick Enquiry: $Email $Name" ,$message,"From:
$email\n")) {
echo "";
} else {
echo; "There was a problem sending the mail. Please check
that you filled in the form correctly.";
?>.oO(stuckinthesystem)
> Here is my php code for the form.
> <?
This should be <?php for portability reasons. Short open
tags are an
optional feature and can be disabled.
> function checkOK($field)
> {
> if (eregi("\r",$field) || eregi("\n",$field)){
The old ereg_* functions should not be used anymore. Better
would be
something like
if (preg_match("/[\n\r]/", $field)) {...}
> $Name=$_POST['Name'];
> checkOK($Name);
> $Email=$_POST['Email'];
> checkOK($Email);
> $Question=$_POST['Question'];
> checkOK($Question);
The last check causes the error if the user enters multiple
lines in the
text area. You can remove that check, because line breaks in
the email
body are safe.
> if(mail($to,"Quick Enquiry: $Email $Name"
,$message,"From: $email\n")) {
> echo "";
There's a typo in the last parameter. Variable names in PHP
are
case-sensitive, so $Email != $email. You should set
error_reporting to
E_ALL in your php.ini, so PHP will let you know about such
errors.
Micha -
SIMPLE ILLUSTRATOR PROBLEM..HELP PLEASEEE
INTRO
hey so i am designing a logo for my uni course, and its due quite soon and i need help on a very simple thing.
OVERVIEW
I've drawn a picture using the line tool, all the lines are connected creating various shapes...
PROBLEM
i need to know how to fill them with colour.... i can slect the shapes i want to fill and use object-live paint-make. but tht means i can only fill...i need to be able to use the mesh tool to create effects....
any help would be greatly appreciated. ThanksProblem is when you use the line tool, where two lines intersect, they stay as seperate entities. In other words the line tool was design to just create a line. However if you want to take the time you can use the point selection tool (lowercase a on keyboard) Drag select the corner where they intersect, right click and select join (windows) (also object>path>join or ctrl-j will work), select the type of corner you want, then hit ok. And repeat for each corner.
When you are done you can give it a fill or a path color and size.
Or create a new layer, (Optional: change the color of the path to make it easier to see what you are doing)
lock the old layer,
select the pen tool and click on top of each corner (point or anchor).
When you reach the last point the cursor will change to tell you that you are closing the path.
At this point you can change the fill and path color/size.
Maybe you are looking for
-
Change folders in save as in web template
Hi, Is it possible to change the default folders in the save as dialog in a web template. We would like to add our custom defined KM folders and not only use the predefinied once. Regards Mattias
-
I updated my OS from 10.6.4., to 10.8.2. I want to buy iDVD and iMovie, but I bought iPhoto and can't get it to work yet. I'm hesitant to buy the others without now having the original applications on my laptop. Do I need to buy the older versions
-
How do I set page margins in Numbers for iPad 1.5
I was attempting to reduce the margins on my first spreadsheet, and I can't seem to find a way to adjust margins or paper size in Numbers 1.5 for iPad. Thanks for any help!
-
Hi BWers, How do i know the no of records a cube has? Also how do i avoid previous request getting deleted while doing full update. Thanks Dave
-
Unable to download BBM on 8520 Curve
Hi, i accidentally deleted my BBM and i dont know how to return it back. i cannot access also thru wifi so that i can upload again thru BB Apps, how can i access in wifi or is they have way to update or to reinstall my BBM thru laptop connection. A