An error in this Applescript that I can't understand
Hi, I searched some forums and found this script below which I modified. It works great except for a single statement:
runScript If = 1 then number error -128 I want the script to do is, when a USB drive is mounted and is in the ignoredVolumes as "USB Untitled" I want the script to stop. What I can't understand is, runScript is set to 1, "Untitled USB" Monte, runScript is not changed, why don't the script stops with an error "user cancelled"? On the other hand, if a key USB Monte is not in the ignoredVolumes, runScript is set to 2 and copy the file I want it. What hurts? It's probably something that will be very obvious when I see the answer.
Thanks for any help with this problem,
Mike.
property ignoredVolumes: {'10,10 30 1. 5 't', 'files 1. 5 't', "Untitled USB"} - add if necessary
property videoExtensions: {"avi", "mov", "mpg", "wmv", "mp4" and "mkv"}
the value newVolume to the alias (POSIX file "/ Volumes/files 1.") ("5T / new")
the value oldVolume to the alias (POSIX file "/ Volumes/files 1.") ("5T / old")
game runScript to 1
tell application "System events".
the value rootVolumes to disk (POSIX file ' / Volumes ' in the text)
the value allVolumes to name of every element of disc of rootVolumes
the value numofallVolumes to the County of allVolumes
Repeat with the present book in allVolumes
say application 'Finder '.
if (the present book is not in ignoredVolumes and (this book as text) is not '. ') DS_Store') then
if there are alias (POSIX (' / Volumes / "& the present book) as text file ) then game runScript to 2
runScript If = 1 then number error -128 - it does not give a 'User cancelled' error when "Untitled USB" is mounted
runScript If = 2 then
try
duplicate (elements whose name is in the videoExtensions extension) in alias (POSIX file (' / Volumes / "& the present book &" / new ") as text) to newVolume
on error number errorNumber errorMessage
_error value of errorMessage
_errorNum the value to errorNumber
If errorNumber is -15267 then
display the dialog box "This file already exists in folder a." buttons {"OK", "No"} default button 1 with the title "Film copy error?" giving upwards after 10
If the returned button of result is 'No' then
Error number-128
on the other
If the result is 'OK' or back button gave up lead and then of
eject the present book
display the dialog box "U S B D r i v e E j e c t e d - K O t o R e m o v e" {"no need to click on this button"} default button 1 button give up after 5
return
end if
end if
end if
end try
Try
duplicate (elements whose name is in the videoExtensions extension) in alias (POSIX file (' / Volumes / "& the present book &" / old ") as text) to oldVolume
on error number errorNumber errorMessage
_error value of errorMessage
_errorNum the value to errorNumber
If errorNumber is -15267 then
display the dialog box "This file already exists in the folder B" buttons {"OK", "No"} default button 1 with the title "Film copy error?" giving upwards after 10
If the returned button of result is 'No' then
Error number-128
on the other
If the result is 'OK' or back button gave up lead and then of
eject the present book
display the dialog box "U S B D r i v e E j e c t e d - K O t o R e m o v e" {"no need to click on this button"} default button 1 button give up after 5
return
end if
end if
end if
end try
display the dialog box "USB key will Auto Eject in 10 seconds or click OK... "buttons button 1 with the title"copy Complete - Eject? "default {'OK', 'No'} which gives after 10
If the returned button of result is 'No' then
Error number-128
on the other
If the button returned of result is "OK" or gave up a result then ejection of the this book
display the dialog box "U S B D r i v e E j e c t e d - K O t o R e m o v e" {"no need to click on this button"} default button 1 button give up after 5
end if
end if
end if
end say
end Repeat
end say
The way in which your external block If is currently based, the script can't do anything when this book is in the ignoredVolumes, it can not yet test the runScript value. Try something like this:
If the present book is in the ignoredVolumes then
game runScript to 1
on the other
if (the present book as text is not '. ') DS_Store') then
if there are alias (POSIX (' / Volumes / "& the present book) as text file ) then game runScript to 2
end if
end if
Of course, you need to remove a "end if' the end of the script.
Tags: Mac OS & System Software
Similar Questions
-
1009 error that I can't understand...
I have a video player with commands that I exported as swf (dialogue). I'm trying to get that video player to open in an another fla (holder.fla) when a certain button is clicked. The problem is when we click the button I get an error #1009 that I can't understand:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at 3_fla::main_mc_1/initVideoPlayer() at 3_fla::main_mc_1/frame1()
initVideoPlayer() is the dialogue function that implements the player controls:
function initVideoPlayer():void { // hide buttons mcVideoControls.btnUnmute.visible = false; mcVideoControls.btnPause.visible = false; // set the progress/preload fill width to 1 mcVideoControls.mcProgressFill.mcFillRed.width = 1; mcVideoControls.mcProgressFill.mcFillGrey.width = 1; // add global event listener when mouse is released stage.addEventListener( MouseEvent.MOUSE_UP, mouseReleased); // add event listeners to all buttons mcVideoControls.btnPause.addEventListener(MouseEvent.CLICK, pauseClicked); mcVideoControls.btnPlay.addEventListener(MouseEvent.CLICK, playClicked); mcVideoControls.btnStop.addEventListener(MouseEvent.CLICK, stopClicked); mcVideoControls.btnMute.addEventListener(MouseEvent.CLICK, muteClicked); mcVideoControls.btnUnmute.addEventListener(MouseEvent.CLICK, unmuteClicked); mcVideoControls.mcVolumeScrubber.btnVolumeScrubber.addEventListener(MouseEvent.MOUSE_DOWN, volumeScrubberClicked); mcVideoControls.mcProgressScrubber.btnProgressScrubber.addEventListener(MouseEvent.MOUSE_DOWN, progressScrubberClicked); // create timer for updating all visual parts of player and add // event listener tmrDisplay = new Timer(DISPLAY_TIMER_UPDATE_DELAY); tmrDisplay.addEventListener(TimerEvent.TIMER, updateDisplay); // create a new net connection, add event listener and connect // to null because we don't have a media server ncConnection = new NetConnection(); ncConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); ncConnection.connect(null); // create a new netstream with the net connection, add event // listener, set client to this for handling meta data and // set the buffer time to the value from the constant nsStream = new NetStream(ncConnection); nsStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); nsStream.client = this; nsStream.bufferTime = BUFFER_TIME; // attach net stream to video object on the stage vidDisplay.attachNetStream(nsStream); // set the smoothing value from the constant vidDisplay.smoothing = SMOOTHING; // set default volume mcVideoControls.mcVolumeScrubber.x = (53 * DEFAULT_VOLUME) + 645.25; mcVideoControls.mcVolumeFill.mcFillRed.width = mcVideoControls.mcVolumeScrubber.x - 698.25 + 53; setVolume(DEFAULT_VOLUME); }
The function is called at the bottom of the rest of the code.The code I use to enter dialogue in holder.fla is:
var img1Request: URLRequest = new URLRequest("videos/3-2-10.swf"); var img1Loader: Loader = new Loader(); btns_mc.marchImg_btn.addEventListener(MouseEvent.CLICK, clickEvent); function clickEvent(event:MouseEvent):void{ img1Loader.load(img1Request); img1Loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadNowEvent); function loadNowEvent(event:Event):void{ container_mc.addChild(img1Loader); } }
Any help is greatly appreciated!
pigeon7081
It is close.
Just remove this line of code to myconst() and you should be good to go.
p.s. Please mark this thread as answered.
-
I bought an iphone6s from Lithuania, EU. At the back of the box, it is printed "Aproved for use in all countries of the EU". Does this mean that I can't use it in Asia?
It does not mean that you cannot use it in Asia. It cannot be repaired in the European Union, however, and may not work with LTE networks in other parts of the world.
-
My creative cloud, 'Applications' tab does not load, how do I fix this so that I can update my Adobe programs for current versions?
Please take a look at this document:
-
Hello, im trying to install CS2 for my mac (yosemite 10.10.3) but it does not work because PowerPC is required! This means that I can't use cs2 with my version? and if I want to use ist what to do? Thank you friends
CS 2 is very old version that uses Power PC, but a newer version than Mac's Intel based processors. CS 2 has been designed according to the Power PC architecture.
-
Error for this user account details can only be updated through the site where it was created first
I get this error will receive try to put in place a new email: "Details of the error for this user account can only be updated through the site where it was created first." What should I do?
My email is down. If you respond by email please send it to [email protected]
Thank you
Rick
All sorted
Thank you very much for your help
2014 12-15 10:04, Anshul.sharma wrote:
ERROR FOR THIS USER ACCOUNT DETAILS CAN ONLY BE UPDATED THROUGH THE SITE WHERE IT WAS CREATED FIRST
created by Anshul.sharma in going live (Emails, users, domains) - discover complete discussion
-
Hi all
I hope there, can someone help me with a Lightroom/Photoshop small but annoying issue. (I saw a similar post on the subject here, but it was for an earlier version of Photoshop Camera Raw and the answers did not help me).
Whenever I choose to edit in > Photoshop in Lightroom to edit a file I get the message error "this version of Lightroom may require plug-ins verson Raw Photoshop Camera 9.3 for full compatibility. Now, I know that I can get Lightroom to make the file or hit continue and that he either will get the job done. But I want to the difficulty of what is the cause. I'm on a Mac OSX Yosemite 10.10.5, I have Lightroom 6.3 (known as camera Raw 9.3 in the section about Lightroom) and I use Photoshop CS6 13.0.6 x 64. I tried to click on help > update in Lightroom and Photoshop, but this has not solved the problem. I tried following the instructions on the Adobe Web site to manually update the Camera Raw plugin that is supposed to be located at (from memory) (root folder) library > Application Support > Adobe > Plugins, but I don't have a Plugins folder (and yes I'm looking in the library under the root folder (, not under my user name).
Advice!
Camera Raw 9.1.1 is the LATEST version which is compatible with Photoshop CS6. You will not be able to update to 9.3. In addition, Lightroom now up to version 6.6. See the note in this article
-
When I delete the files they go in the trash and will stay there until I log out and switch on the computer.
When I turn it back on and open a session in the basket is still empty.
I can't find any settings to change that.
Can someone advise?Hi Jack,
Windows Vista does not clear the trash automatically on closing of session/reboots. This must be due to a third-party program (CCleaner / Zone Alarm clear function Cache) you have installed. You may need to consider starting applications and find which of them is the compensation the basket every time.
Ramesh Srinivasan, Microsoft MVP [Windows Desktop Experience]
-
I've just been pretty stupid to fall for this scam that I can do to cancel it
Yesterday I got a call, the Indian person on the line, told me it was a visit of courtesy from microsoft and was offered for free, I asked again if this was the case and he assured me it is, he says, his name was Daniel.
I am in my seventies and that I recently had problems with my P.C.I fell for his line, I have pretty basic computer knowledge.
He showed me on my computer that I got a lot of mail something or other which in turn could contain viruses, I said that I do not understand that, as I had Macafee protection and previously Norton he told me that two of them were incompatible with my p C is windows 7At the end of the long conversation, he said he could offer me 2 years of technical protection at a price of £139,98
V.A.T. a total of £158,96 and like the more fool I feel now that I paid with my master card.He said someone would ring me back today and he did, he just asked me if my computer was working ok promised to send another mail electronic, but that never happened so far.
I was already starting to be pretty worried I could have fallen for a clever scam, yesterday they sent me a confirmation of billing,
He said that all the phone calls for technical support were free on 0844 2720796 of course that I printed of thisGave me this web site address www.onlinetechmate.com. I just looked on the website and the comments at the end of the wiser and more knowledgeable people on P.Cs how they were taken about this type of scam
Please can you help me maybe, I now feel physically ill, I do all my banking online and transfers and often buy online they claim to be trained Microsoft technicians - what can I do to stop payment or anything at all I can do to get me out of trouble, I think I have left me to please advise me and help me if you can thanks
You should call your credit card company and let them know about this fraud. They can cancel the charge for you. Also, you need to assign you a new number of credit card and cancel the old.
If this individual "Daniel" has been authorized to have access online to your computer, you have no way of knowing what information he may have gotten, and what are the settings he could change. You should contact any financial institution you deal with and let them know that your account has been compromised.
You must change your passwords online for the financial institutions, or companies where you do shopping online, using a known clean computer. Do not access these accounts of the infected computer until it has been restructured and the operating system reinstalled.
-
A few weeks back, I started to download the trial version of Flash CS3 (I'm still using Flash 8, but have created a CS3 also file I want to re - save as Flash 8). Unfortunately, the internet link breaks when that 80% have downloaded. Adobe has taken, I have download - does that mean that I can't try to download it again? (When I try to do if there is a brief flurry of activity, and then nothing happens.)
If you follow the 7 steps you can dl a free trial here: http://prodesigntools.com/download-adobe-cs4-and-cs3-free-trials-here.html
and activate it with your serial number.
If you have a problem dl'g, you don't follow all 7 steps. the most common mistake is not meticulously follow the steps 1, 2, and/or 3 (which adds a cookie to your system, allowing you to download the correct version of the adobe.com site). Thus, your browser must accept cookies for these downloads.
-
Confused about replacement of the object style that I can't understand
Hello
So I'll try to understand and to clean up a book a bit messy, I inherited (lots of inconsistent style and replacements). There are a bunch of boxes that have a style of object applied to them, but seem to have odd substitutions, which I can't understand how even got implemented Medallion.
In particular, they have a substitution of "text frame General Options (spacing inset at left; Inset spacing on the right. I can't understand how you can even replace the object for this style.
Even more strange, the paragraph style has a right of withdrawal. 0625 "and the withdrawal to the left of 0, but on the screen, I see the left indent is also. 0625 ". Even if it is not specified anywhere.
Inside the style, is the inset spacing. 0.25 "right and left 25" and it's actually how the text is aligned. But it is clear lines on screens as if there is a left and right inset of 0,1875 "and a withdrawal of paragraph 0,0625 on both sides, when styles don't say this.
Why do I care about all this? Well, I need to convert this CS6, and when I did, I found an extra. 0625 "Indent on the right side causing overset text. This led me down this rabbit hole.
I know I have to get rid of all completely replacements and I intend to do at some point, but I can't do it right now for reasons of time, and I'm also actually really curious what is happening here. Anyone have any ideas? Thank you.
You have shown a paragraph style, but not necessarily one that is actually used. I have no way of knowing what calls for the definition of object style (but I see a substitution for the paragraph style), or what style is assigned to the text in this framework.
Messed up, it is probably a good description of the current state, but to understand what is wrong, you will have to dig into what is really defined as opposed to what the appeal of styles to, then delete the replacements or redefine styles to give you what you want and probably some of both.
You can use find/replace to find a style and replace it with itself to remove the replacements, I recall.
-
mistake, that I can't understand
Hello
I have this script in a submit button:
Create a variable to hold the document object
var oDoc = event.target;
oDoc.mailDoc({)
bUI: true,
cTo: heading.system.rawValue,.
cCc:
' bassujetti: heading.sevLevel.rawValue ' - '+ heading.description.rawValue' - '+ heading.location.formattedValue,
"CMSG: formFields.symptoms.rawValue ' - '+ formFields.whoExp.rawValue' - '+ formFields.whereOccurred.rawValue' - '+ formFields.whatEquip.rawValue' - '+ formFields.troubleShooting.rawValue,
});
{When I check the script, I get a message waited} line 9. I can't understand what is wrong.
Thank you
MDawn
You are missing a plus + before your ' - '.
Kyle
-
When preparing update of Firefox 4 for Firefox 5, a message appears that says Logmein 1.0.0.652 plugin is not compatible. I need Logmein daily. So should I stay in FF4 until this problem is solved?
The LogMeIn add-on has been updated the other day to "LogMeIn, Inc. Remote Access Plugin version 1.0.0.664.
To try to get this pushed to you, uninstall the old add-on, then reconnect to LogMeIn.
To uninstall:
Orange Firefox button or Tools menu > Modules
On the left side, click Extensions. Here, you should be able to take off and turn it back on.
Then connect to LogMeIn again and the new version should be pushed to you.
Once you have it, you can proceed with your update for Firefox 5.
Doing a job?
-
I'm unable to set up Outlook, or now called windows mail, I think. but for the life of me I do not understand how to configure the e-mail program that comes with now it windows Vista 64 that came on my new pc. can someone please? Thank you
Windows Mail is/was not Outlook.
Windows XP e-mail program called Outlook Express.
Outlook is a part of the office.
Windows Mail in Vista is the replacement of e-mail for Outlook Express (XP) program.
Read this section on how to set up Windows Mail in Vista:
http://www.SimpleHelp.NET/2007/02/07/a-beginners-guide-to-setting-up-Windows-Mail/
Link above has an easy to follow Guide to set up Windows Mail.
Contact your ISP (Internet Service Provider).
They offer your broad band/Dial-up connection.
Ask them to:
username
password for your service account to wide band/Dial-Up with themServer of incoming POP3 mail
outgoing mail SMTP serverThe above information is required to set up Windows Mail.
ISPS are usually happy to help you set up your email account.
See you soon.
Mick Murphy - Microsoft partner
-
I called your support in India or something, she can't help me, but give me another number; 80036981. I call this and learning that this number is not in use. = Why) (& ("/ () /") (/ () & # () "= is so difficult to buy a solution you?))
Looks like you may want to consider the device instead of the individual licenses licenses.
Creative cloud for education is available through the Adobe Value Incentive Plan (VIP) for classrooms and laboratories.
With this type of license, you purchase licenses for each computer, instead of each user.
These are purchased through a reseller of certified training Adobe.
Or you can find a dealer here call 800-443-8158 for more information.
This link can help too. Scroll the comparative table:
http://www.Adobe.com/creativecloud/buy/education.html
Guinot
Maybe you are looking for
-
How to hide the 'Network' icon in the dialog box "save in".
Hello I use the service of Windows 2008 server TS, I would appreciate if you can let me know how I can hide the 'Network' icon under "save in" option in the dialog box "save under" in various applications please, e, g, Notepad or MS Office 2003. Than
-
Daisy chaining with other routers and the common IP range EA6500 V2
I have a local network of... a modem a gateway connected to the modem computer/server has a modem-router connected to the gateway/server via the port of the gateway/internet(gateway/a two server NETWORK interface card) a and B modem router wireless c
-
Discs Blue ray is not recognized in the Combo Blue ray/DVD/CD player in Windows Vista
I use windows vista in Sony Vio laptop (model-VGN-FZ21M). I have a blue ray/DVD/CD player Combo on it. A few months before this record supported the blue ray discs. But now it does not recognize the Blue ray discs. Could you please tell where what to
-
my emails arrive already open... How can I fix it.
emails are coming OPEN... HOW TO SOLVE THIS PROBLEM?
-
How to destroy an object persistent on the removal of the application
Is it possible to make an app that retrieves a persistent object and start when the application is removed by the user, the application also removes the object persistent (using PersistentStore.destroyPersistentObject (long key))