RogerRabbitsClone Posted June 23, 2010 Share Posted June 23, 2010 hello again autoiters. ok, what im trying to make this do is read the clipboard, (it will always be reading a number) and insert that number into the name of the file im trying to open with shellexecute. $numbercheck = ClipGet () $templatedir = "\\Bserver\dtp\AA - Use this for sample\UC BUS CARD\" ShellExecute("BC - UCB - $numbercheck.indd", "", $templateDir, "edit") the files are called BC - UCB - 1.indd BC - UCB - 2.indd etc, up to 10 it didnt say anything about this in the online docs, is this possible? <--a good way to start you day Link to comment Share on other sites More sharing options...
Skruge Posted June 23, 2010 Share Posted June 23, 2010 A few ways to do this would be with the ExpandVarStrings option, concatenation (&), or StringFormat.Check those out and post back if you get stuck. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 23, 2010 Share Posted June 23, 2010 You just didn't assemble the string correctly. The variable needs to be outside the quotes: "BC - UCB - " & $numbercheck & ".indd" Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
RogerRabbitsClone Posted June 23, 2010 Author Share Posted June 23, 2010 (edited) psaltyDS, your a frikkin genius. but its still not working. i double checked the location and the formating of the file name (where the spaces are). can shellexecute open InDesign files? can shellexecute open from a local server? this is the error message i get "Windows cannot find 'BC - UCB - 6.indd'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search." nevermind, im a moron. i was using this: ShellExecute("BC - UCB - " & $numbercheck & ".indd") instead of this: ShellExecute("BC - UCB - " & $numbercheck & ".indd", "", $templatedir) thanks guys Edited June 23, 2010 by RogerRabbitsClone <--a good way to start you day Link to comment Share on other sites More sharing options...
GEOSoft Posted June 23, 2010 Share Posted June 23, 2010 It's looking in the script folder for the files. Is that where they are located? If not you need the full path to the file in ShellExecute() George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
l3ill Posted June 24, 2010 Share Posted June 24, 2010 (edited) Additional Tip: you may have to execute your indd files like this: Local $indd = ("path To Indd file") ShellExecute('Indesign.exe', $indd) basically opening indesign first and the opening the file you want. I had this problem with PDF files... Edited June 24, 2010 by billo My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
GEOSoft Posted June 24, 2010 Share Posted June 24, 2010 Additional Tip: you may have to execute your indd files like this: Local $indd = ("path To Indd file") ShellExecute('Indesign.exe', $indd) basically opening indesign first and the opening the file you want. I had this problem with PDF files... That happens when there is no file association created for a file type. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
RogerRabbitsClone Posted July 10, 2010 Author Share Posted July 10, 2010 actually i did get it to work ShellExecute("BC - UCB - " & $numbercheck & ".indd", "", $templatedir) <--a good way to start you day Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now